diff --git a/build/minified/modules/carousel.js b/build/minified/modules/carousel.js new file mode 100644 index 000000000..e95867e0f --- /dev/null +++ b/build/minified/modules/carousel.js @@ -0,0 +1,325 @@ +/* ****************************** + Semantic Module: Carousel + Author: Jack Lukic + Notes: First Commit May 28, 2013 + + A carousel alternates between + several pieces of content in sequence. + +****************************** */ + +;(function ( $, window, document, undefined ) { + +$.fn.carousel = function(parameters) { + var + $allModules = $(this), + + settings = $.extend(true, {}, $.fn.carousel.settings, parameters), + + eventNamespace = '.' + settings.namespace, + moduleNamespace = 'module-' + settings.namespace, + moduleSelector = $allModules.selector || '', + + time = new Date().getTime(), + performance = [], + + query = arguments[0], + methodInvoked = (typeof query == 'string'), + queryArguments = [].slice.call(arguments, 1), + invokedResponse + ; + + $allModules + .each(function() { + var + $module = $(this), + $arrows = $(settings.selector.arrows), + $leftArrow = $(settings.selector.leftArrow), + $rightArrow = $(settings.selector.rightArrow), + $content = $(settings.selector.content), + $navigation = $(settings.selector.navigation), + $navItem = $(settings.selector.navItem), + + selector = $module.selector || '', + element = this, + instance = $module.data('module-' + settings.namespace), + + className = settings.className, + namespace = settings.namespace, + errors = settings.errors, + module + ; + + module = { + + initialize: function() { + module.openingAnimation(); + module.marquee.autoAdvance(); + $leftArrow + .on('click', module.marquee.left) + ; + $rightArrow + .on('click', module.marquee.right) + ; + $navItem + .on('click', module.marquee.change) + ; + }, + + destroy: function() { + module.verbose('Destroying previous module for', $module); + $module + .off(namespace) + ; + }, + + left: function() { + var + $activeContent = $content.filter('.' + className.active), + currentIndex = $content.index($activeContent), + imageCount = $content.size(), + newIndex = (currentIndex - 1 != -1) + ? (currentIndex - 1) + : (imageCount - 1) + ; + $navItem + .eq(newIndex) + .trigger('click') + ; + }, + + right: function() { + var + $activeContent = $content.filter('.' + className.active), + currentIndex = $content.index($activeContent), + imageCount = $content.size(), + newIndex = (currentIndex + 1 != imageCount) + ? (currentIndex + 1) + : 0 + ; + $navItem + .eq(newIndex) + .trigger('click') + ; + }, + + change: function() { + var + $selected = $(this), + selectedIndex = $navItem.index($selected), + $selectedImage = $content.eq(selectedIndex) + ; + module.marquee.autoAdvance(); + $selected + .addClass('active') + .siblings() + .removeClass('active') + ; + $selectedImage + .addClass('active animated fadeIn') + .siblings('.' + className.active) + .removeClass('animated fadeIn scaleIn') + .animate({ + opacity: 0 + }, 500, function(){ + $(this) + .removeClass('active') + .removeAttr('style') + ; + }) + ; + }, + + autoAdvance: function() { + clearInterval(module.timer); + module.timer = setInterval(module.marquee.right, settings.duration); + }, + + setting: function(name, value) { + if(value !== undefined) { + if( $.isPlainObject(name) ) { + module.verbose('Modifying settings object', name, value); + $.extend(true, settings, name); + } + else { + module.verbose('Modifying setting', name, value); + settings[name] = value; + } + } + else { + return settings[name]; + } + }, + internal: function(name, value) { + if(value !== undefined) { + if( $.isPlainObject(name) ) { + module.verbose('Modifying internal property', name, value); + $.extend(true, module, name); + } + else { + module.verbose('Changing internal method to', value); + module[name] = value; + } + } + else { + return module[name]; + } + }, + debug: function() { + if(settings.debug) { + if(settings.performance) { + module.performance.log(arguments); + } + else { + module.debug = Function.prototype.bind.call(console.info, console, settings.moduleName + ':'); + } + } + }, + verbose: function() { + if(settings.verbose && settings.debug) { + if(settings.performance) { + module.performance.log(arguments); + } + else { + module.verbose = Function.prototype.bind.call(console.info, console, settings.moduleName + ':'); + } + } + }, + error: function() { + module.error = Function.prototype.bind.call(console.log, console, settings.moduleName + ':'); + }, + performance: { + log: function(message) { + var + currentTime, + executionTime, + previousTime + ; + if(settings.performance) { + currentTime = new Date().getTime(); + previousTime = time || currentTime, + executionTime = currentTime - previousTime; + time = currentTime; + performance.push({ + 'Element' : element, + 'Name' : message[0], + 'Arguments' : message[1] || 'None', + 'Execution Time' : executionTime + }); + clearTimeout(module.performance.timer); + module.performance.timer = setTimeout(module.performance.display, 100); + } + }, + display: function() { + var + title = settings.moduleName, + caption = settings.moduleName + ': ' + moduleSelector + '(' + $allModules.size() + ' elements)', + totalExecutionTime = 0 + ; + if(moduleSelector) { + title += ' Performance (' + moduleSelector + ')'; + } + if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) { + console.groupCollapsed(title); + if(console.table) { + $.each(performance, function(index, data) { + totalExecutionTime += data['Execution Time']; + }); + console.table(performance); + } + else { + $.each(performance, function(index, data) { + totalExecutionTime += data['Execution Time']; + console.log(data['Name'] + ': ' + data['Execution Time']+'ms'); + }); + } + console.log('Total Execution Time:', totalExecutionTime +'ms'); + console.groupEnd(); + performance = []; + time = false; + } + } + }, + invoke: function(query, passedArguments, context) { + var + maxDepth, + found + ; + passedArguments = passedArguments || queryArguments; + context = element || context; + if(typeof query == 'string' && instance !== undefined) { + query = query.split('.'); + maxDepth = query.length - 1; + $.each(query, function(depth, value) { + if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { + instance = instance[value]; + return true; + } + else if( instance[value] !== undefined ) { + found = instance[value]; + return true; + } + module.error(errors.method); + return false; + }); + } + if ( $.isFunction( found ) ) { + module.verbose('Executing invoked function', found); + return found.apply(context, passedArguments); + } + return found || false; + } + }; + + if(methodInvoked) { + if(instance === undefined) { + module.initialize(); + } + invokedResponse = module.invoke(query); + } + else { + if(instance !== undefined) { + module.destroy(); + } + module.initialize(); + } + }) + ; + return (invokedResponse) + ? invokedResponse + : this + ; +}; + +$.fn.carousel.settings = { + + moduleName : 'Carousel Module', + namespace : 'carousel', + + verbose : true, + debug : true, + performance : true, + + // delegated event context + duration: 5000, + + errors : { + method : 'The method you called is not defined.' + }, + + selector : { + arrows : '.arrow', + leftArrow : '.left.arrow', + rightArrow : '.right.arrow', + content : '.content', + navigation : '.navigation', + navItem : '.navigation .icon' + }, + + className : { + active : 'active' + } + +}; + +})( jQuery, window , document ); diff --git a/build/minified/modules/carousel.min.js b/build/minified/modules/carousel.min.js new file mode 100644 index 000000000..7cd2fe4d5 --- /dev/null +++ b/build/minified/modules/carousel.min.js @@ -0,0 +1 @@ +(function(e,t,n,o){e.fn.carousel=function(t){var n,i=e(this),a=e.extend(!0,{},e.fn.carousel.settings,t),r=("."+a.namespace,"module-"+a.namespace,i.selector||""),s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1);return i.each(function(){var t,f=e(this),m=(e(a.selector.arrows),e(a.selector.leftArrow)),g=e(a.selector.rightArrow),p=e(a.selector.content),v=(e(a.selector.navigation),e(a.selector.navItem)),h=(f.selector||"",this),b=f.data("module-"+a.namespace),x=a.className,y=a.namespace,w=a.errors;t={initialize:function(){t.openingAnimation(),t.marquee.autoAdvance(),m.on("click",t.marquee.left),g.on("click",t.marquee.right),v.on("click",t.marquee.change)},destroy:function(){t.verbose("Destroying previous module for",f),f.off(y)},left:function(){var e=p.filter("."+x.active),t=p.index(e),n=p.size(),o=-1!=t-1?t-1:n-1;v.eq(o).trigger("click")},right:function(){var e=p.filter("."+x.active),t=p.index(e),n=p.size(),o=t+1!=n?t+1:0;v.eq(o).trigger("click")},change:function(){var n=e(this),o=v.index(n),i=p.eq(o);t.marquee.autoAdvance(),n.addClass("active").siblings().removeClass("active"),i.addClass("active animated fadeIn").siblings("."+x.active).removeClass("animated fadeIn scaleIn").animate({opacity:0},500,function(){e(this).removeClass("active").removeAttr("style")})},autoAdvance:function(){clearInterval(t.timer),t.timer=setInterval(t.marquee.right,a.duration)},setting:function(n,i){return i===o?a[n]:(e.isPlainObject(n)?(t.verbose("Modifying settings object",n,i),e.extend(!0,a,n)):(t.verbose("Modifying setting",n,i),a[n]=i),o)},internal:function(n,i){return i===o?t[n]:(e.isPlainObject(n)?(t.verbose("Modifying internal property",n,i),e.extend(!0,t,n)):(t.verbose("Changing internal method to",i),t[n]=i),o)},debug:function(){a.debug&&(a.performance?t.performance.log(arguments):t.debug=Function.prototype.bind.call(console.info,console,a.moduleName+":"))},verbose:function(){a.verbose&&a.debug&&(a.performance?t.performance.log(arguments):t.verbose=Function.prototype.bind.call(console.info,console,a.moduleName+":"))},error:function(){t.error=Function.prototype.bind.call(console.log,console,a.moduleName+":")},performance:{log:function(e){var n,o,i;a.performance&&(n=(new Date).getTime(),i=s||n,o=n-i,s=n,c.push({Element:h,Name:e[0],Arguments:e[1]||"None","Execution Time":o}),clearTimeout(t.performance.timer),t.performance.timer=setTimeout(t.performance.display,100))},display:function(){var t=a.moduleName,n=(a.moduleName+": "+r+"("+i.size()+" elements)",0);r&&(t+=" Performance ("+r+")"),(console.group!==o||console.table!==o)&&c.length>0&&(console.groupCollapsed(t),console.table?(e.each(c,function(e,t){n+=t["Execution Time"]}),console.table(c)):e.each(c,function(e,t){n+=t["Execution Time"],console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.log("Total Execution Time:",n+"ms"),console.groupEnd(),c=[],s=!1)}},invoke:function(n,i,a){var r,s;return i=i||d,a=h||a,"string"==typeof n&&b!==o&&(n=n.split("."),r=n.length-1,e.each(n,function(n,i){return e.isPlainObject(b[i])&&n!=r?(b=b[i],!0):b[i]!==o?(s=b[i],!0):(t.error(w.method),!1)})),e.isFunction(s)?(t.verbose("Executing invoked function",s),s.apply(a,i)):s||!1}},u?(b===o&&t.initialize(),n=t.invoke(l)):(b!==o&&t.destroy(),t.initialize())}),n?n:this},e.fn.carousel.settings={moduleName:"Carousel Module",namespace:"carousel",verbose:!0,debug:!0,performance:!0,duration:5e3,errors:{method:"The method you called is not defined."},selector:{arrows:".arrow",leftArrow:".left.arrow",rightArrow:".right.arrow",content:".content",navigation:".navigation",navItem:".navigation .icon"},className:{active:"active"}}})(jQuery,window,document); \ No newline at end of file diff --git a/build/minified/modules/chat.min.js b/build/minified/modules/chat.min.js index a2a50e2da..c1a20fe9e 100644 --- a/build/minified/modules/chat.min.js +++ b/build/minified/modules/chat.min.js @@ -1 +1 @@ -(function(e,t,n,o){e.fn.chat=function(t,n,a){var i=e.extend(!0,{},e.fn.chat.settings,a),s=arguments||!1;return e(this).each(function(){var a,r,l,c,u,d,f=e(this),m=f.find(i.selector.expandButton),p=f.find(i.selector.userListButton),g=f.find(i.selector.userList),h=(f.find(i.selector.room),f.find(i.selector.userCount)),v=f.find(i.selector.log),b=(f.find(i.selector.message),f.find(i.selector.messageInput)),y=f.find(i.selector.messageButton),x=f.data("module"),C=i.className,w=i.namespace,T="",k={};return d={channel:!1,width:{log:v.width(),userList:g.outerWidth()},initialize:function(){return Pusher===o&&d.error(i.errors.pusher),t===o||n===o?(d.error(i.errors.key),!1):i.endpoint.message||i.endpoint.authentication?(u=new Pusher(t),Pusher.channel_auth_endpoint=i.endpoint.authentication,d.channel=u.subscribe(n),d.channel.bind("pusher:subscription_succeeded",d.user.list.create),d.channel.bind("pusher:subscription_error",d.error),d.channel.bind("pusher:member_added",d.user.joined),d.channel.bind("pusher:member_removed",d.user.left),d.channel.bind("update_messages",d.message.receive),e.each(i.customEvents,function(e,t){d.channel.bind(e,t)}),e.fn.hoverClass!==o&&e.fn.downClass!==o&&(m.hoverClass().downClass(),p.hoverClass().downClass(),y.hoverClass().downClass()),p.on("click."+w,d.event.toggleUserList),m.on("click."+w,d.event.toggleExpand),b.on("keydown."+w,d.event.input.keydown).on("keyup."+w,d.event.input.keyup),y.on("mouseenter."+w,d.event.hover).on("mouseleave."+w,d.event.hover).on("click."+w,d.event.submit),v.animate({scrollTop:v.prop("scrollHeight")},400),f.data("module",d).addClass(C.loading),o):(d.error(i.errors.endpoint),!1)},refresh:function(){p.removeClass(C.active),d.width={log:v.width(),userList:g.outerWidth()},p.hasClass(C.active)&&d.user.list.hide(),f.data("module",d)},user:{updateCount:function(){i.userCount&&(k=f.data("users"),l=0,e.each(k,function(){l++}),h.html(i.templates.userCount(l)))},joined:function(t){k=f.data("users"),"anonymous"!=t.id&&k[t.id]===o&&(k[t.id]=t.info,i.randomColor&&t.info.color===o&&(t.info.color=i.templates.color(t.id)),T=i.templates.userList(t.info),t.info.isAdmin?e(T).prependTo(g).preview({type:"user",placement:"left"}):e(T).appendTo(g).preview({type:"user",placement:"left"}),e.fn.preview!==o&&g.children().last().preview({type:"user",placement:"left"}),i.partingMessages&&(v.append(i.templates.joined(t.info)),d.message.scroll.test()),d.user.updateCount())},left:function(e){k=f.data("users"),e!==o&&"anonymous"!==e.id&&(delete k[e.id],f.data("users",k),g.find("[data-id="+e.id+"]").remove(),i.partingMessages&&(v.append(i.templates.left(e.info)),d.message.scroll.test()),d.user.updateCount())},list:{create:function(t){k={},t.each(function(e){"anonymous"!==e.id&&"undefined"!==e.id&&(i.randomColor&&e.info.color===o&&(e.info.color=i.templates.color(e.id)),T=e.info.isAdmin?i.templates.userList(e.info)+T:T+i.templates.userList(e.info),k[e.id]=e.info)}),f.data("users",k).data("user",k[t.me.id]).removeClass(C.loading),g.html(T),e.fn.preview!==o&&g.children().preview({type:"user",placement:"left"}),d.user.updateCount(),e.proxy(i.onJoin,g.children())()},show:function(){v.animate({width:d.width.log-d.width.userList},{duration:i.speed,easing:i.easing,complete:d.message.scroll.move})},hide:function(){v.stop().animate({width:d.width.log},{duration:i.speed,easing:i.easing,complete:d.message.scroll.move})}}},message:{scroll:{test:function(){c=v.prop("scrollHeight")-v.height(),Math.abs(v.scrollTop()-c)'+e.user.name+": ":''+e.user.name+": ",t+=""+e.text+"

"+""},joined:function(e){return typeof e.name!==o?'
'+e.name+" has joined the chat.
":!1},left:function(e){return typeof e.name!==o?'
'+e.name+" has left the chat.
":!1},userList:function(e){var t="";return e.isAdmin&&(e.color="#55356A"),t+='
'+'
'+' '+"
",t+=e.color!==o?'

'+e.name+"

":'

'+e.name+"

",t+="
"}}}})(jQuery,window,document); \ No newline at end of file +(function(e,t,n,o){e.fn.chat=function(t,n,a){var i=e.extend(!0,{},e.fn.chat.settings,a),s=arguments||!1;return e(this).each(function(){var a,r,l,c,u,d,f=e(this),m=f.find(i.selector.expandButton),p=f.find(i.selector.userListButton),g=f.find(i.selector.userList),v=(f.find(i.selector.room),f.find(i.selector.userCount)),h=f.find(i.selector.log),b=(f.find(i.selector.message),f.find(i.selector.messageInput)),y=f.find(i.selector.messageButton),x=f.data("module"),C=i.className,w=i.namespace,T="",k={};return d={channel:!1,width:{log:h.width(),userList:g.outerWidth()},initialize:function(){return Pusher===o&&d.error(i.errors.pusher),t===o||n===o?(d.error(i.errors.key),!1):i.endpoint.message||i.endpoint.authentication?(u=new Pusher(t),Pusher.channel_auth_endpoint=i.endpoint.authentication,d.channel=u.subscribe(n),d.channel.bind("pusher:subscription_succeeded",d.user.list.create),d.channel.bind("pusher:subscription_error",d.error),d.channel.bind("pusher:member_added",d.user.joined),d.channel.bind("pusher:member_removed",d.user.left),d.channel.bind("update_messages",d.message.receive),e.each(i.customEvents,function(e,t){d.channel.bind(e,t)}),e.fn.hoverClass!==o&&e.fn.downClass!==o&&(m.hoverClass().downClass(),p.hoverClass().downClass(),y.hoverClass().downClass()),p.on("click."+w,d.event.toggleUserList),m.on("click."+w,d.event.toggleExpand),b.on("keydown."+w,d.event.input.keydown).on("keyup."+w,d.event.input.keyup),y.on("mouseenter."+w,d.event.hover).on("mouseleave."+w,d.event.hover).on("click."+w,d.event.submit),h.animate({scrollTop:h.prop("scrollHeight")},400),f.data("module",d).addClass(C.loading),o):(d.error(i.errors.endpoint),!1)},refresh:function(){p.removeClass(C.active),d.width={log:h.width(),userList:g.outerWidth()},p.hasClass(C.active)&&d.user.list.hide(),f.data("module",d)},user:{updateCount:function(){i.userCount&&(k=f.data("users"),l=0,e.each(k,function(){l++}),v.html(i.templates.userCount(l)))},joined:function(t){k=f.data("users"),"anonymous"!=t.id&&k[t.id]===o&&(k[t.id]=t.info,i.randomColor&&t.info.color===o&&(t.info.color=i.templates.color(t.id)),T=i.templates.userList(t.info),t.info.isAdmin?e(T).prependTo(g).preview({type:"user",placement:"left"}):e(T).appendTo(g).preview({type:"user",placement:"left"}),e.fn.preview!==o&&g.children().last().preview({type:"user",placement:"left"}),i.partingMessages&&(h.append(i.templates.joined(t.info)),d.message.scroll.test()),d.user.updateCount())},left:function(e){k=f.data("users"),e!==o&&"anonymous"!==e.id&&(delete k[e.id],f.data("users",k),g.find("[data-id="+e.id+"]").remove(),i.partingMessages&&(h.append(i.templates.left(e.info)),d.message.scroll.test()),d.user.updateCount())},list:{create:function(t){k={},t.each(function(e){"anonymous"!==e.id&&"undefined"!==e.id&&(i.randomColor&&e.info.color===o&&(e.info.color=i.templates.color(e.id)),T=e.info.isAdmin?i.templates.userList(e.info)+T:T+i.templates.userList(e.info),k[e.id]=e.info)}),f.data("users",k).data("user",k[t.me.id]).removeClass(C.loading),g.html(T),e.fn.preview!==o&&g.children().preview({type:"user",placement:"left"}),d.user.updateCount(),e.proxy(i.onJoin,g.children())()},show:function(){h.animate({width:d.width.log-d.width.userList},{duration:i.speed,easing:i.easing,complete:d.message.scroll.move})},hide:function(){h.stop().animate({width:d.width.log},{duration:i.speed,easing:i.easing,complete:d.message.scroll.move})}}},message:{scroll:{test:function(){c=h.prop("scrollHeight")-h.height(),Math.abs(h.scrollTop()-c)'+e.user.name+": ":''+e.user.name+": ",t+=""+e.text+"

"+""},joined:function(e){return typeof e.name!==o?'
'+e.name+" has joined the chat.
":!1},left:function(e){return typeof e.name!==o?'
'+e.name+" has left the chat.
":!1},userList:function(e){var t="";return e.isAdmin&&(e.color="#55356A"),t+='
'+'
'+' '+"
",t+=e.color!==o?'

'+e.name+"

":'

'+e.name+"

",t+="
"}}}})(jQuery,window,document); \ No newline at end of file diff --git a/build/minified/modules/checkbox.min.js b/build/minified/modules/checkbox.min.js index 729e509a7..fe113ad1e 100644 --- a/build/minified/modules/checkbox.min.js +++ b/build/minified/modules/checkbox.min.js @@ -1 +1 @@ -(function(e,t,n,o){e.fn.checkbox=function(t){var n,a=e(this),i=e.extend(!0,{},e.fn.checkbox.settings,t),s="."+i.namespace,r="module-"+i.namespace,l=a.selector||"",c=(new Date).getTime(),u=[],d=arguments[0],f="string"==typeof d,m=[].slice.call(arguments,1);return a.each(function(){var t,p=e(this),g=e(this).find(i.selector.input),h=p.selector||"",v=this,b=p.data("module-"+i.namespace),y=i.className,x=i.namespace,C=i.errors;t={initialize:function(){i.context&&""!==h?(t.verbose("Initializing checkbox with delegated events",p),e(v,i.context).on(h,"click"+s,t.toggle).data(r,t)):(t.verbose("Initializing checkbox with bound events",p),p.on("click"+s,t.toggle).data(r,t))},destroy:function(){t.verbose("Destroying previous module for",p),p.off(x)},is:{radio:function(){return p.hasClass(y.radio)}},can:{disable:function(){return"boolean"==typeof i.required?i.required:!t.is.radio()}},enable:function(){t.debug("Enabling checkbox"),p.addClass(y.active),g.prop("checked",!0),e.proxy(i.onChange,g.get())(),e.proxy(i.onEnable,g.get())()},disable:function(){t.debug("Disabling checkbox"),p.removeClass(y.active),g.prop("checked",!1),e.proxy(i.onChange,g.get())(),e.proxy(i.onDisable,g.get())()},toggle:function(){t.verbose("Toggling checkbox state"),g.prop("checked")!==o&&g.prop("checked")?t.can.disable()&&t.disable():t.enable()},setting:function(n,a){return a===o?i[n]:(e.isPlainObject(n)?(t.verbose("Modifying settings object",n,a),e.extend(!0,i,n)):(t.verbose("Modifying setting",n,a),i[n]=a),o)},internal:function(n,a){return a===o?t[n]:(e.isPlainObject(n)?(t.verbose("Modifying internal property",n,a),e.extend(!0,t,n)):(t.verbose("Changing internal method to",a),t[n]=a),o)},debug:function(){i.debug&&(i.performance?t.performance.log(arguments):t.debug=Function.prototype.bind.call(console.info,console,i.moduleName+":"))},verbose:function(){i.verbose&&i.debug&&(i.performance?t.performance.log(arguments):t.verbose=Function.prototype.bind.call(console.info,console,i.moduleName+":"))},error:function(){t.error=Function.prototype.bind.call(console.log,console,i.moduleName+":")},performance:{log:function(e){var n,o,a;i.performance&&(n=(new Date).getTime(),a=c||n,o=n-a,c=n,u.push({Element:v,Name:e[0],Arguments:e[1]||"None","Execution Time":o}),clearTimeout(t.performance.timer),t.performance.timer=setTimeout(t.performance.display,100))},display:function(){var t=i.moduleName,n=(i.moduleName+": "+l+"("+a.size()+" elements)",0);l&&(t+=" Performance ("+l+")"),(console.group!==o||console.table!==o)&&u.length>0&&(console.groupCollapsed(t),console.table?(e.each(u,function(e,t){n+=t["Execution Time"]}),console.table(u)):e.each(u,function(e,t){n+=t["Execution Time"],console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.log("Total Execution Time:",n+"ms"),console.groupEnd(),u=[],c=!1)}},invoke:function(n,a,i){var s,r;return a=a||m,i=v||i,"string"==typeof n&&b!==o&&(n=n.split("."),s=n.length-1,e.each(n,function(n,a){return e.isPlainObject(b[a])&&n!=s?(b=b[a],!0):b[a]!==o?(r=b[a],!0):(t.error(C.method),!1)})),e.isFunction(r)?(t.verbose("Executing invoked function",r),r.apply(i,a)):r||!1}},f?(b===o&&t.initialize(),n=t.invoke(d)):(b!==o&&t.destroy(),t.initialize())}),n?n:this},e.fn.checkbox.settings={moduleName:"Checkbox Module",namespace:"checkbox",verbose:!0,debug:!0,performance:!0,context:!1,required:"auto",onChange:function(){},onEnable:function(){},onDisable:function(){},errors:{method:"The method you called is not defined."},selector:{input:"input"},className:{active:"active",radio:"radio"}}})(jQuery,window,document); \ No newline at end of file +(function(e,t,n,o){e.fn.checkbox=function(t){var n,a=e(this),i=e.extend(!0,{},e.fn.checkbox.settings,t),s="."+i.namespace,r="module-"+i.namespace,c=a.selector||"",l=(new Date).getTime(),u=[],d=arguments[0],f="string"==typeof d,m=[].slice.call(arguments,1);return a.each(function(){var t,p=e(this),g=e(this).find(i.selector.input),h=p.selector||"",v=this,b=p.data("module-"+i.namespace),y=i.className,x=i.namespace,C=i.errors;t={initialize:function(){i.context&&""!==h?(t.verbose("Initializing checkbox with delegated events",p),e(v,i.context).on(h,"click"+s,t.toggle).data(r,t)):(t.verbose("Initializing checkbox with bound events",p),p.on("click"+s,t.toggle).data(r,t))},destroy:function(){t.verbose("Destroying previous module for",p),p.off(x)},is:{radio:function(){return p.hasClass(y.radio)}},can:{disable:function(){return"boolean"==typeof i.required?i.required:!t.is.radio()}},enable:function(){t.debug("Enabling checkbox"),p.addClass(y.active),g.prop("checked",!0),e.proxy(i.onChange,g.get())(),e.proxy(i.onEnable,g.get())()},disable:function(){t.debug("Disabling checkbox"),p.removeClass(y.active),g.prop("checked",!1),e.proxy(i.onChange,g.get())(),e.proxy(i.onDisable,g.get())()},toggle:function(){t.verbose("Toggling checkbox state"),g.prop("checked")!==o&&g.prop("checked")?t.can.disable()&&t.disable():t.enable()},setting:function(n,a){return a===o?i[n]:(e.isPlainObject(n)?(t.verbose("Modifying settings object",n,a),e.extend(!0,i,n)):(t.verbose("Modifying setting",n,a),i[n]=a),o)},internal:function(n,a){return a===o?t[n]:(e.isPlainObject(n)?(t.verbose("Modifying internal property",n,a),e.extend(!0,t,n)):(t.verbose("Changing internal method to",a),t[n]=a),o)},debug:function(){i.debug&&(i.performance?t.performance.log(arguments):t.debug=Function.prototype.bind.call(console.info,console,i.moduleName+":"))},verbose:function(){i.verbose&&i.debug&&(i.performance?t.performance.log(arguments):t.verbose=Function.prototype.bind.call(console.info,console,i.moduleName+":"))},error:function(){t.error=Function.prototype.bind.call(console.log,console,i.moduleName+":")},performance:{log:function(e){var n,o,a;i.performance&&(n=(new Date).getTime(),a=l||n,o=n-a,l=n,u.push({Element:v,Name:e[0],Arguments:e[1]||"None","Execution Time":o}),clearTimeout(t.performance.timer),t.performance.timer=setTimeout(t.performance.display,100))},display:function(){var t=i.moduleName,n=(i.moduleName+": "+c+"("+a.size()+" elements)",0);c&&(t+=" Performance ("+c+")"),(console.group!==o||console.table!==o)&&u.length>0&&(console.groupCollapsed(t),console.table?(e.each(u,function(e,t){n+=t["Execution Time"]}),console.table(u)):e.each(u,function(e,t){n+=t["Execution Time"],console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.log("Total Execution Time:",n+"ms"),console.groupEnd(),u=[],l=!1)}},invoke:function(n,a,i){var s,r;return a=a||m,i=v||i,"string"==typeof n&&b!==o&&(n=n.split("."),s=n.length-1,e.each(n,function(n,a){return e.isPlainObject(b[a])&&n!=s?(b=b[a],!0):b[a]!==o?(r=b[a],!0):(t.error(C.method),!1)})),e.isFunction(r)?(t.verbose("Executing invoked function",r),r.apply(i,a)):r||!1}},f?(b===o&&t.initialize(),n=t.invoke(d)):(b!==o&&t.destroy(),t.initialize())}),n?n:this},e.fn.checkbox.settings={moduleName:"Checkbox Module",namespace:"checkbox",verbose:!0,debug:!0,performance:!0,context:!1,required:"auto",onChange:function(){},onEnable:function(){},onDisable:function(){},errors:{method:"The method you called is not defined."},selector:{input:"input"},className:{active:"active",radio:"radio"}}})(jQuery,window,document); \ No newline at end of file diff --git a/build/minified/modules/dropdown.min.js b/build/minified/modules/dropdown.min.js index d4d5e41e6..2bc26ef44 100644 --- a/build/minified/modules/dropdown.min.js +++ b/build/minified/modules/dropdown.min.js @@ -1 +1 @@ -(function(e,t,n,o){e.fn.dropdown=function(t){var i,a=e(this),s=e(n),r=e.extend(!0,{},e.fn.dropdown.settings,t),c="."+r.namespace,l="module-"+r.namespace,u=(a.selector||"",(new Date).getTime()),d=[],f=arguments[0],m="string"==typeof f,g=[].slice.call(arguments,1);return a.each(function(){var t,p=e(this),h=e(this).find(r.selector.menu),v=e(this).find(r.selector.item),b=e(this).find(r.selector.text),y=e(this).find(r.selector.input),x="ontouchstart"in n.documentElement,C=p.selector||"",w=this,T=p.data("module-"+r.namespace),k=r.className,N=r.metadata,z=r.namespace,P=r.animation,D=r.errors;t={initialize:function(){t.verbose("Initializing dropdown with bound events",p),x?p.on("touchstart"+c,t.event.test.toggle):"click"==r.on?p.on("click"+c,t.event.test.toggle):"hover"==r.on?p.on("mouseenter"+c,t.show).on("mouseleave"+c,t.delayedHide):p.on(r.on+c,t.toggle),"form"==r.action&&t.set.selected(),v.on(t.get.selectEvent()+c,t.event.item.click),p.data(l,t)},destroy:function(){t.verbose("Destroying previous module for",p),p.off(z)},event:{stopPropagation:function(e){e.stopPropagation()},test:{toggle:function(e){t.intent.test(e,t.toggle),e.stopPropagation()},hide:function(e){t.intent.test(e,t.hide),e.stopPropagation()}},item:{click:function(){var n=e(this),o=n.data(N.text)||n.text(),i=n.data(N.value)||o;t.verbose("Adding active state to selected item"),v.removeClass(k.active),n.addClass(k.active),t.action.determine(o,i),e.proxy(r.onChange,h.get())(o,i)}}},intent:{test:function(n,o){t.debug("Determining whether event occurred in dropdown",n.target),o=o||function(){},0===e(n.target).closest(h).size()?(t.verbose("Triggering event",o),o()):t.verbose("Event occurred in dropdown, canceling callback")},bind:function(){t.verbose("Binding hide intent event to document"),s.on(t.get.selectEvent(),t.event.test.hide)},unbind:function(){t.verbose("Removing hide intent event from document"),s.off(t.get.selectEvent())}},action:{determine:function(n,o){e.isFunction(t.action[r.action])?(t.verbose("Triggering preset action",r.action),t.action[r.action](n,o)):e.isFunction(r.action)?(t.verbose("Triggering user action",r.action),r.action(n,o)):t.error(D.action)},nothing:function(){},hide:function(){t.hide()},changeText:function(e){t.set.text(e),t.hide()},form:function(e,n){t.set.text(e),t.set.value(n),t.hide()}},get:{selectEvent:function(){return x?"touchstart":"click"},text:function(){return b.text()},value:function(){return y.val()},item:function(t){var n;return t=t||y.val(),v.each(function(){e(this).data(N.value)==t&&(n=e(this))}),n}},set:{text:function(e){t.debug("Changing text",e),b.text(e)},value:function(e){t.debug("Adding selected value to hidden input",e),y.val(e)},selected:function(e){var n=(e||y.val(),t.get.item(e)),o=n.data(N.text)||n.text();t.debug("Setting selected menu item to",n),v.removeClass(k.active),n.addClass(k.active),t.set.text(o)}},is:{visible:function(){return h.is(":visible")},hidden:function(){return h.is(":not(:visible)")}},can:{click:function(){return x||"click"==r.on},show:function(){return!p.hasClass(k.disabled)}},animate:{show:function(){t.verbose("Doing menu showing animation"),"show"==P.show?h.show():"slide"==P.show&&h.clearQueue().children().clearQueue().css("opacity",0).delay(100).animate({opacity:1},300,"easeOutQuad").end().slideDown(200,"easeOutQuad")},hide:function(){t.verbose("Doing menu hiding animation"),"hide"==P.hide?h.hide():"slide"==P.hide&&h.clearQueue().children().clearQueue().css("opacity",1).animate({opacity:0},300,"easeOutQuad").end().delay(100).slideUp(200,"easeOutQuad")}},show:function(){clearTimeout(t.graceTimer),t.is.visible()||(t.debug("Showing dropdown"),p.addClass(k.visible),t.animate.show(),t.can.click()&&t.intent.bind(),e.proxy(r.onShow,h.get())())},delayedHide:function(){t.verbose("User moused away setting timer to hide dropdown"),t.graceTimer=setTimeout(t.hide,r.gracePeriod)},hide:function(){t.is.hidden()||(t.debug("Hiding dropdown"),p.removeClass(k.visible),t.can.click()&&t.intent.unbind(),t.animate.hide(),e.proxy(r.onHide,h.get())())},toggle:function(){t.verbose("Toggling menu visibility"),t.can.show()?t.show():t.hide()},setting:function(t,n){return n===o?r[t]:(e.isPlainObject(t)?e.extend(!0,r,t):r[t]=n,o)},internal:function(n,i){return i===o?t[n]:(e.isPlainObject(n)?e.extend(!0,t,n):t[n]=i,o)},debug:function(){r.debug&&(r.performance?t.performance.log(arguments):t.debug=Function.prototype.bind.call(console.info,console,r.moduleName+":"))},verbose:function(){r.verbose&&r.debug&&(r.performance?t.performance.log(arguments):t.verbose=Function.prototype.bind.call(console.info,console,r.moduleName+":"))},error:function(){t.error=Function.prototype.bind.call(console.log,console,r.moduleName+":")},performance:{log:function(e){var n,o,i;r.performance&&(n=(new Date).getTime(),i=u||n,o=n-i,u=n,d.push({Element:w,Name:e[0],Arguments:e[1]||"None","Execution Time":o}),clearTimeout(t.performance.timer),t.performance.timer=setTimeout(t.performance.display,100))},display:function(){var t=r.moduleName,n=(r.moduleName+": "+C+"("+a.size()+" elements)",0);C&&(t+=" Performance ("+C+")"),(console.group!==o||console.table!==o)&&d.length>0&&(console.groupCollapsed(t),console.table?(e.each(d,function(e,t){n+=t["Execution Time"]}),console.table(d)):e.each(d,function(e,t){n+=t["Execution Time"],console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.log("Total Execution Time:",n+"ms"),console.groupEnd(),d=[],u=!1)}},invoke:function(n,i,a){var s,r;return i=i||g,a=w||a,"string"==typeof n&&T!==o&&(n=n.split("."),s=n.length-1,e.each(n,function(n,i){return e.isPlainObject(T[i])&&n!=s?(T=T[i],!0):T[i]!==o?(r=T[i],!0):(t.error(D.method),!1)})),e.isFunction(r)?(t.verbose("Executing invoked function",r),r.apply(a,i)):r||!1}},m?(T===o&&t.initialize(),i=t.invoke(f)):(T!==o&&t.destroy(),t.initialize())}),i?i:this},e.fn.dropdown.settings={moduleName:"Dropdown Module",namespace:"dropdown",verbose:!0,debug:!0,performance:!0,on:"click",gracePeriod:300,action:"hide",animation:{show:"slide",hide:"slide"},onChange:function(){},onShow:function(){},onHide:function(){},errors:{action:"You called a dropdown action that was not defined",method:"The method you called is not defined."},metadata:{text:"text",value:"value"},selector:{menu:".menu",item:".menu > .item",text:"> .text",input:'> input[type="hidden"]'},className:{active:"active",disabled:"disabled",visible:"visible"}}})(jQuery,window,document); \ No newline at end of file +(function(e,t,n,o){e.fn.dropdown=function(t){var i,a=e(this),s=e(n),r=e.extend(!0,{},e.fn.dropdown.settings,t),c="."+r.namespace,l="module-"+r.namespace,u=(a.selector||"",(new Date).getTime()),d=[],m=arguments[0],f="string"==typeof m,g=[].slice.call(arguments,1);return a.each(function(){var t,p=e(this),h=e(this).find(r.selector.menu),v=e(this).find(r.selector.item),b=e(this).find(r.selector.text),y=e(this).find(r.selector.input),x="ontouchstart"in n.documentElement,C=p.selector||"",w=this,T=p.data("module-"+r.namespace),k=r.className,N=r.metadata,z=r.namespace,P=r.animation,E=r.errors;t={initialize:function(){t.verbose("Initializing dropdown with bound events",p),x?p.on("touchstart"+c,t.event.test.toggle):"click"==r.on?p.on("click"+c,t.event.test.toggle):"hover"==r.on?p.on("mouseenter"+c,t.show).on("mouseleave"+c,t.delayedHide):p.on(r.on+c,t.toggle),"form"==r.action&&t.set.selected(),v.on(t.get.selectEvent()+c,t.event.item.click),p.data(l,t)},destroy:function(){t.verbose("Destroying previous module for",p),p.off(z)},event:{stopPropagation:function(e){e.stopPropagation()},test:{toggle:function(e){t.intent.test(e,t.toggle),e.stopPropagation()},hide:function(e){t.intent.test(e,t.hide),e.stopPropagation()}},item:{click:function(){var n=e(this),o=n.data(N.text)||n.text(),i=n.data(N.value)||o;t.verbose("Adding active state to selected item"),v.removeClass(k.active),n.addClass(k.active),t.action.determine(o,i),e.proxy(r.onChange,h.get())(o,i)}}},intent:{test:function(n,o){t.debug("Determining whether event occurred in dropdown",n.target),o=o||function(){},0===e(n.target).closest(h).size()?(t.verbose("Triggering event",o),o()):t.verbose("Event occurred in dropdown, canceling callback")},bind:function(){t.verbose("Binding hide intent event to document"),s.on(t.get.selectEvent(),t.event.test.hide)},unbind:function(){t.verbose("Removing hide intent event from document"),s.off(t.get.selectEvent())}},action:{determine:function(n,o){e.isFunction(t.action[r.action])?(t.verbose("Triggering preset action",r.action),t.action[r.action](n,o)):e.isFunction(r.action)?(t.verbose("Triggering user action",r.action),r.action(n,o)):t.error(E.action)},nothing:function(){},hide:function(){t.hide()},changeText:function(e){t.set.text(e),t.hide()},form:function(e,n){t.set.text(e),t.set.value(n),t.hide()}},get:{selectEvent:function(){return x?"touchstart":"click"},text:function(){return b.text()},value:function(){return y.val()},item:function(t){var n;return t=t||y.val(),v.each(function(){e(this).data(N.value)==t&&(n=e(this))}),n}},set:{text:function(e){t.debug("Changing text",e),b.text(e)},value:function(e){t.debug("Adding selected value to hidden input",e),y.val(e)},selected:function(e){var n=(e||y.val(),t.get.item(e)),o=n.data(N.text)||n.text();t.debug("Setting selected menu item to",n),v.removeClass(k.active),n.addClass(k.active),t.set.text(o)}},is:{visible:function(){return h.is(":visible")},hidden:function(){return h.is(":not(:visible)")}},can:{click:function(){return x||"click"==r.on},show:function(){return!p.hasClass(k.disabled)}},animate:{show:function(){t.verbose("Doing menu showing animation"),"show"==P.show?h.show():"slide"==P.show&&h.clearQueue().children().clearQueue().css("opacity",0).delay(100).animate({opacity:1},300,"easeOutQuad").end().slideDown(200,"easeOutQuad")},hide:function(){t.verbose("Doing menu hiding animation"),"hide"==P.hide?h.hide():"slide"==P.hide&&h.clearQueue().children().clearQueue().css("opacity",1).animate({opacity:0},300,"easeOutQuad").end().delay(100).slideUp(200,"easeOutQuad")}},show:function(){clearTimeout(t.graceTimer),t.is.visible()||(t.debug("Showing dropdown"),p.addClass(k.visible),t.animate.show(),t.can.click()&&t.intent.bind(),e.proxy(r.onShow,h.get())())},delayedHide:function(){t.verbose("User moused away setting timer to hide dropdown"),t.graceTimer=setTimeout(t.hide,r.gracePeriod)},hide:function(){t.is.hidden()||(t.debug("Hiding dropdown"),p.removeClass(k.visible),t.can.click()&&t.intent.unbind(),t.animate.hide(),e.proxy(r.onHide,h.get())())},toggle:function(){t.verbose("Toggling menu visibility"),t.can.show()?t.show():t.hide()},setting:function(t,n){return n===o?r[t]:(e.isPlainObject(t)?e.extend(!0,r,t):r[t]=n,o)},internal:function(n,i){return i===o?t[n]:(e.isPlainObject(n)?e.extend(!0,t,n):t[n]=i,o)},debug:function(){r.debug&&(r.performance?t.performance.log(arguments):t.debug=Function.prototype.bind.call(console.info,console,r.moduleName+":"))},verbose:function(){r.verbose&&r.debug&&(r.performance?t.performance.log(arguments):t.verbose=Function.prototype.bind.call(console.info,console,r.moduleName+":"))},error:function(){t.error=Function.prototype.bind.call(console.log,console,r.moduleName+":")},performance:{log:function(e){var n,o,i;r.performance&&(n=(new Date).getTime(),i=u||n,o=n-i,u=n,d.push({Element:w,Name:e[0],Arguments:e[1]||"None","Execution Time":o}),clearTimeout(t.performance.timer),t.performance.timer=setTimeout(t.performance.display,100))},display:function(){var t=r.moduleName,n=(r.moduleName+": "+C+"("+a.size()+" elements)",0);C&&(t+=" Performance ("+C+")"),(console.group!==o||console.table!==o)&&d.length>0&&(console.groupCollapsed(t),console.table?(e.each(d,function(e,t){n+=t["Execution Time"]}),console.table(d)):e.each(d,function(e,t){n+=t["Execution Time"],console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.log("Total Execution Time:",n+"ms"),console.groupEnd(),d=[],u=!1)}},invoke:function(n,i,a){var s,r;return i=i||g,a=w||a,"string"==typeof n&&T!==o&&(n=n.split("."),s=n.length-1,e.each(n,function(n,i){return e.isPlainObject(T[i])&&n!=s?(T=T[i],!0):T[i]!==o?(r=T[i],!0):(t.error(E.method),!1)})),e.isFunction(r)?(t.verbose("Executing invoked function",r),r.apply(a,i)):r||!1}},f?(T===o&&t.initialize(),i=t.invoke(m)):(T!==o&&t.destroy(),t.initialize())}),i?i:this},e.fn.dropdown.settings={moduleName:"Dropdown Module",namespace:"dropdown",verbose:!0,debug:!0,performance:!0,on:"click",gracePeriod:300,action:"hide",animation:{show:"slide",hide:"slide"},onChange:function(){},onShow:function(){},onHide:function(){},errors:{action:"You called a dropdown action that was not defined",method:"The method you called is not defined."},metadata:{text:"text",value:"value"},selector:{menu:".menu",item:".menu > .item",text:"> .text",input:'> input[type="hidden"]'},className:{active:"active",disabled:"disabled",visible:"visible"}}})(jQuery,window,document); \ No newline at end of file diff --git a/build/minified/modules/form.min.js b/build/minified/modules/form.min.js index 09a0a93fd..758c03758 100644 --- a/build/minified/modules/form.min.js +++ b/build/minified/modules/form.min.js @@ -1 +1 @@ -(function(e,t,n,o){e.fn.form=function(t,i){var a,r=e(this),s=(e(n),e.extend(!0,{},e.fn.form.settings,i)),c=("."+s.namespace,"module-"+s.namespace,r.selector||""),l=(new Date).getTime(),u=[],d=arguments[0],f="string"==typeof d,m=[].slice.call(arguments,1);return r.each(function(){var n,i=e(this),p=e(this).find(s.selector.group),g=e(this).find(s.selector.field),h=(e(this).find(s.selector.prompt),[]),v=this,b=i.data("module-"+s.namespace),y=s.namespace,x=s.metadata,w=s.className,C=s.errors;n={initialize:function(){n.verbose("Initializing form validation"),t===o&&e.isEmptyObject(t)?n.error(C.noFields,i):"submit"==s.on&&i.on("submit."+y,n.validate.form)},destroy:function(){i.off(y)},refresh:function(){g=i.find(s.selector.field)},field:{find:function(t){return n.refresh(),g.filter("#"+t).size()>0?g.filter("#"+t):g.filter('[name="'+t+'"]').size()>0?g.filter('[name="'+t+'"]'):g.filter("[data-"+x.validate+'="'+t+'"]').size()>0?g.filter("[data-"+x.validate+'="'+t+'"]'):e("")},add:{error:function(t,o){var i=n.field.find(t.identifier),a=i.closest(p),r=p.find(r),c=0!==r.size();a.addClass(w.error),s.inlineError&&(c||(r=e("
").addClass(w.prompt).insertBefore(i)),r.html(o[0]).fadeIn(s.animateSpeed))}},remove:{error:function(e){var t=n.field.find(e.identifier),o=t.closest(p),i=p.find(i);o.removeClass(w.error),s.inlineError&&i.hide()}}},validate:{form:function(o){var i=!0;return h=[],e.each(t,function(e,t){n.validate.field(t)||(i=!1)}),i?e.proxy(s.onSuccess,this)(o):e.proxy(s.onFailure,this)(h)},field:function(t){var i=n.field.find(t.identifier),a=!0,r=[];return t.rules!==o&&e.each(t.rules,function(e,o){n.validate.rule(t,o)||(n.debug("Field is invalid",t.identifier,o.type),r.push(o.prompt),a=!1)}),a?(n.field.remove.error(t,r),s.onValid(i),!0):(h=h.concat(r),n.field.add.error(t,r),e.proxy(s.onInvalid,i)(r),!1)},rule:function(t,a){var r,c,l=n.field.find(t.identifier),u=a.type,d=l.val(),f=/\[(.*?)\]/i,m=f.exec(u),p=!0;return m!==o&&null!=m?(r=m[1],c=u.replace(m[0],""),p=e.proxy(s.rules[c],i)(d,r)):p="checked"==u?l.filter(":checked").size()>0:s.rules[u](d),p}},setting:function(t,n){return n===o?s[t]:(e.isPlainObject(t)?e.extend(!0,s,t):s[t]=n,o)},internal:function(t,i){return i===o?n[t]:(e.isPlainObject(t)?e.extend(!0,n,t):n[t]=i,o)},debug:function(){s.debug&&(n.performance.log(arguments[0]),n.debug=Function.prototype.bind.call(console.log,console,s.moduleName+":"))},verbose:function(){s.verbose&&s.debug&&(n.performance.log(arguments[0]),n.verbose=Function.prototype.bind.call(console.info,console,s.moduleName+":"))},error:function(){n.error=Function.prototype.bind.call(console.log,console,s.moduleName+":")},performance:{log:function(e){var t,o,i;s.performance&&(t=(new Date).getTime(),i=l||t,o=t-i,l=t,u.push({Element:v,Name:e,"Execution Time":o}),clearTimeout(n.performance.timer),n.performance.timer=setTimeout(n.performance.display,100))},display:function(){var t=s.moduleName,n=(s.moduleName+": "+c+"("+r.size()+" elements)",0);c&&(t+="Performance ("+c+")"),(console.group!==o||console.table!==o)&&u.length>0&&(console.groupCollapsed(t),console.table?(e.each(u,function(e,t){n+=t["Execution Time"]}),console.table(u)):e.each(u,function(e,t){n+=t["Execution Time"]}),console.log("Total Execution Time:",n+"ms"),console.groupEnd(),u=[],l=!1)}},invoke:function(t,i,a){var r,s;return i=i||m,a=v||a,"string"==typeof t&&b!==o&&(t=t.split("."),r=t.length-1,e.each(t,function(t,i){return e.isPlainObject(b[i])&&t!=r?(b=b[i],!0):b[i]!==o?(s=b[i],!0):(n.error(C.method),!1)})),e.isFunction(s)?(n.verbose("Executing invoked function",s),s.apply(a,i)):s||!1}},f?(b===o&&n.initialize(),a=n.invoke(d)):(b!==o&&n.destroy(),n.initialize())}),a?a:this},e.fn.form.settings={moduleName:"Validate Form Module",debug:!0,verbose:!1,namespace:"validate",animateSpeed:150,inlineError:!1,on:"submit",onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},metadata:{validate:"validate"},errors:{method:"The method you called is not defined.",noFields:"No validation object specified."},selector:{group:".field",prompt:".prompt",field:"input, textarea, select"},className:{error:"error",prompt:"prompt"},defaults:{firstName:{identifier:"first-name",rules:[{type:"empty",prompt:"Please enter your first name"}]},lastName:{identifier:"last-name",rules:[{type:"empty",prompt:"Please enter your last name"}]},username:{identifier:"username",rules:[{type:"email",prompt:"Please enter a username"}]},email:{identifier:"email",rules:[{type:"empty",prompt:"Please enter your email"},{type:"email",prompt:"Please enter a valid email"}]},password:{identifier:"password",rules:[{type:"empty",prompt:"Please enter a password"},{type:"length[6]",prompt:"Your password must be at least 6 characters"}]},passwordConfirm:{identifier:"password-confirm",rules:[{type:"empty",prompt:"Please confirm your password"},{identifier:"password-confirm",type:"match[password]",prompt:"Please verify password matches"}]},terms:{identifier:"terms",rules:[{type:"checked",prompt:"You must agree to the terms and conditions"}]}},rules:{empty:function(e){return!(e===o||""===e)},email:function(e){var t=RegExp("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?");return t.test(e)},length:function(e,t){return e!==o?e.length>=t:!1},not:function(e,t){return e!=t},maxLength:function(e,t){return e!==o?t>=e.length:!1},match:function(t,n){var i,a=e(this);return a.find("#"+n).size()>0?i=a.find("#"+n).val():a.find("[name="+n+"]").size()>0?i=a.find("[name="+n+"]").val():a.find('[data-validate="'+n+'"]').size()>0&&(i=a.find('[data-validate="'+n+'"]').val()),i!==o?""+t==""+i:!1},url:function(e){var t=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)}}}})(jQuery,window,document); \ No newline at end of file +(function(e,t,n,o){e.fn.form=function(t,i){var a,r=e(this),s=(e(n),e.extend(!0,{},e.fn.form.settings,i)),c=("."+s.namespace,"module-"+s.namespace,r.selector||""),l=(new Date).getTime(),u=[],d=arguments[0],m="string"==typeof d,f=[].slice.call(arguments,1);return r.each(function(){var n,i=e(this),p=e(this).find(s.selector.group),g=e(this).find(s.selector.field),h=(e(this).find(s.selector.prompt),[]),v=this,b=i.data("module-"+s.namespace),y=s.namespace,x=s.metadata,w=s.className,C=s.errors;n={initialize:function(){n.verbose("Initializing form validation"),t===o&&e.isEmptyObject(t)?n.error(C.noFields,i):"submit"==s.on&&i.on("submit."+y,n.validate.form)},destroy:function(){i.off(y)},refresh:function(){g=i.find(s.selector.field)},field:{find:function(t){return n.refresh(),g.filter("#"+t).size()>0?g.filter("#"+t):g.filter('[name="'+t+'"]').size()>0?g.filter('[name="'+t+'"]'):g.filter("[data-"+x.validate+'="'+t+'"]').size()>0?g.filter("[data-"+x.validate+'="'+t+'"]'):e("")},add:{error:function(t,o){var i=n.field.find(t.identifier),a=i.closest(p),r=p.find(r),c=0!==r.size();a.addClass(w.error),s.inlineError&&(c||(r=e("
").addClass(w.prompt).insertBefore(i)),r.html(o[0]).fadeIn(s.animateSpeed))}},remove:{error:function(e){var t=n.field.find(e.identifier),o=t.closest(p),i=p.find(i);o.removeClass(w.error),s.inlineError&&i.hide()}}},validate:{form:function(o){var i=!0;return h=[],e.each(t,function(e,t){n.validate.field(t)||(i=!1)}),i?e.proxy(s.onSuccess,this)(o):e.proxy(s.onFailure,this)(h)},field:function(t){var i=n.field.find(t.identifier),a=!0,r=[];return t.rules!==o&&e.each(t.rules,function(e,o){n.validate.rule(t,o)||(n.debug("Field is invalid",t.identifier,o.type),r.push(o.prompt),a=!1)}),a?(n.field.remove.error(t,r),s.onValid(i),!0):(h=h.concat(r),n.field.add.error(t,r),e.proxy(s.onInvalid,i)(r),!1)},rule:function(t,a){var r,c,l=n.field.find(t.identifier),u=a.type,d=l.val(),m=/\[(.*?)\]/i,f=m.exec(u),p=!0;return f!==o&&null!=f?(r=f[1],c=u.replace(f[0],""),p=e.proxy(s.rules[c],i)(d,r)):p="checked"==u?l.filter(":checked").size()>0:s.rules[u](d),p}},setting:function(t,n){return n===o?s[t]:(e.isPlainObject(t)?e.extend(!0,s,t):s[t]=n,o)},internal:function(t,i){return i===o?n[t]:(e.isPlainObject(t)?e.extend(!0,n,t):n[t]=i,o)},debug:function(){s.debug&&(n.performance.log(arguments[0]),n.debug=Function.prototype.bind.call(console.log,console,s.moduleName+":"))},verbose:function(){s.verbose&&s.debug&&(n.performance.log(arguments[0]),n.verbose=Function.prototype.bind.call(console.info,console,s.moduleName+":"))},error:function(){n.error=Function.prototype.bind.call(console.log,console,s.moduleName+":")},performance:{log:function(e){var t,o,i;s.performance&&(t=(new Date).getTime(),i=l||t,o=t-i,l=t,u.push({Element:v,Name:e,"Execution Time":o}),clearTimeout(n.performance.timer),n.performance.timer=setTimeout(n.performance.display,100))},display:function(){var t=s.moduleName,n=(s.moduleName+": "+c+"("+r.size()+" elements)",0);c&&(t+="Performance ("+c+")"),(console.group!==o||console.table!==o)&&u.length>0&&(console.groupCollapsed(t),console.table?(e.each(u,function(e,t){n+=t["Execution Time"]}),console.table(u)):e.each(u,function(e,t){n+=t["Execution Time"]}),console.log("Total Execution Time:",n+"ms"),console.groupEnd(),u=[],l=!1)}},invoke:function(t,i,a){var r,s;return i=i||f,a=v||a,"string"==typeof t&&b!==o&&(t=t.split("."),r=t.length-1,e.each(t,function(t,i){return e.isPlainObject(b[i])&&t!=r?(b=b[i],!0):b[i]!==o?(s=b[i],!0):(n.error(C.method),!1)})),e.isFunction(s)?(n.verbose("Executing invoked function",s),s.apply(a,i)):s||!1}},m?(b===o&&n.initialize(),a=n.invoke(d)):(b!==o&&n.destroy(),n.initialize())}),a?a:this},e.fn.form.settings={moduleName:"Validate Form Module",debug:!0,verbose:!1,namespace:"validate",animateSpeed:150,inlineError:!1,on:"submit",onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},metadata:{validate:"validate"},errors:{method:"The method you called is not defined.",noFields:"No validation object specified."},selector:{group:".field",prompt:".prompt",field:"input, textarea, select"},className:{error:"error",prompt:"prompt"},defaults:{firstName:{identifier:"first-name",rules:[{type:"empty",prompt:"Please enter your first name"}]},lastName:{identifier:"last-name",rules:[{type:"empty",prompt:"Please enter your last name"}]},username:{identifier:"username",rules:[{type:"email",prompt:"Please enter a username"}]},email:{identifier:"email",rules:[{type:"empty",prompt:"Please enter your email"},{type:"email",prompt:"Please enter a valid email"}]},password:{identifier:"password",rules:[{type:"empty",prompt:"Please enter a password"},{type:"length[6]",prompt:"Your password must be at least 6 characters"}]},passwordConfirm:{identifier:"password-confirm",rules:[{type:"empty",prompt:"Please confirm your password"},{identifier:"password-confirm",type:"match[password]",prompt:"Please verify password matches"}]},terms:{identifier:"terms",rules:[{type:"checked",prompt:"You must agree to the terms and conditions"}]}},rules:{empty:function(e){return!(e===o||""===e)},email:function(e){var t=RegExp("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?");return t.test(e)},length:function(e,t){return e!==o?e.length>=t:!1},not:function(e,t){return e!=t},maxLength:function(e,t){return e!==o?t>=e.length:!1},match:function(t,n){var i,a=e(this);return a.find("#"+n).size()>0?i=a.find("#"+n).val():a.find("[name="+n+"]").size()>0?i=a.find("[name="+n+"]").val():a.find('[data-validate="'+n+'"]').size()>0&&(i=a.find('[data-validate="'+n+'"]').val()),i!==o?""+t==""+i:!1},url:function(e){var t=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)}}}})(jQuery,window,document); \ No newline at end of file diff --git a/build/minified/modules/nag.min.js b/build/minified/modules/nag.min.js index e5976ecfc..63440c099 100644 --- a/build/minified/modules/nag.min.js +++ b/build/minified/modules/nag.min.js @@ -1 +1 @@ -(function(e,t,n,o){e.fn.nag=function(n){var i=e.extend(!0,{},e.fn.nag.settings,n),a=arguments||!1;return e(this).each(function(){var n,s,r,c,l,u,d,f,m,p=e(this),g=p.find(i.selector.close),h=e(i.context),v=p.data("module"),b=i.className,y=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return m={initialize:function(){n=p.offset(),s=p.outerHeight(),r=h.outerWidth(),c=h.outerHeight(),l=h.offset(),p.data("module",m),g.on("mouseenter mouseleave",m.event.hover).on("click",m.dismiss),i.context==t&&"fixed"==i.position&&p.addClass(b.fixed),i.sticky&&("absolute"==i.position?h.on("scroll resize",m.event.scroll):e(t).on("scroll resize",m.event.scroll),e.proxy(m.event.scroll,this)()),i.followLink&&p.on("mouseenter mouseleave",m.event.hover).on("click",m.followLink),i.displayTime>0&&setTimeout(m.hide,i.displayTime),m.should.show()?p.is(":visible")||m.show():m.hide()},refresh:function(){n=p.offset(),s=p.outerHeight(),r=h.outerWidth(),c=h.outerHeight(),l=h.offset()},show:function(){e.fn.popIn!==o?p.popIn(i.duration):p.fadeIn(i.duration,i.easing)},hide:function(){p.fadeOut(i.duration,i.easing)},stick:function(){if(m.refresh(),"fixed"==i.position){var n=e(t).prop("pageYOffset")||e(t).scrollTop(),o=p.hasClass(b.bottom)?l.top+(c-s)-n:l.top-n;p.css({position:"fixed",top:o,left:l.left,width:r-i.scrollBarWidth})}else p.css({top:d})},unStick:function(){p.css({top:""})},dismiss:function(){i.storageMethod&&m.storage.set(i.storedKey,i.storedValue),m.hide()},should:{show:function(){return m.storage.get(i.storedKey)==i.storedValue?!1:!0},stick:function(){return u=h.prop("pageYOffset")||h.scrollTop(),d=p.hasClass(b.bottom)?c-p.outerHeight()+u:u,d>n.top?!0:"fixed"==i.position?!0:!1}},followLink:function(){e.fn.followLink!==o&&p.followLink()},storage:{set:function(t,n){"local"==i.storageMethod&&store!==o?store.set(t,n):e.cookie!==o?e.cookie(t,n):m.error(i.errors.noStorage)},get:function(t){return"local"==i.storageMethod&&store!==o?store.get(t):e.cookie!==o?e.cookie(t):(m.error(i.errors.noStorage),o)}},event:{hover:function(){e(this).toggleClass(b.hover)},scroll:function(){f!==o&&clearTimeout(f),f=setTimeout(function(){m.should.stick()?y(m.stick):m.unStick()},i.lag)}},error:function(e){console.log("Nag Module:"+e)},invoke:function(t,n,a){var s;return a=a||Array.prototype.slice.call(arguments,2),"string"==typeof t&&v!==o&&(t=t.split("."),e.each(t,function(t,n){return e.isPlainObject(v[n])?(v=v[n],!0):e.isFunction(v[n])?(s=v[n],!0):(m.error(i.errors.method),!1)})),e.isFunction(s)?s.apply(n,a):s}},v!==o&&a?("invoke"==a[0]&&(a=Array.prototype.slice.call(a,1)),m.invoke(a[0],this,Array.prototype.slice.call(a,1))):(m.initialize(),o)}),this},e.fn.nag.settings={displayTime:0,followLink:!0,position:"fixed",scrollBarWidth:18,storageMethod:"cookie",storedKey:"nag",storedValue:"dismiss",sticky:!0,lag:0,context:t,errors:{noStorage:"Neither $.cookie or store is defined. A storage solution is required for storing state",followLink:"Follow link is set but the plugin is not included"},className:{bottom:"bottom",hover:"hover",fixed:"fixed"},selector:{close:".icon.close"},speed:500,easing:"easeOutQuad"}})(jQuery,window,document); \ No newline at end of file +(function(e,t,n,o){e.fn.nag=function(n){var i=e.extend(!0,{},e.fn.nag.settings,n),a=arguments||!1;return e(this).each(function(){var n,r,s,c,l,u,d,m,f,p=e(this),g=p.find(i.selector.close),h=e(i.context),v=p.data("module"),b=i.className,y=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return f={initialize:function(){n=p.offset(),r=p.outerHeight(),s=h.outerWidth(),c=h.outerHeight(),l=h.offset(),p.data("module",f),g.on("mouseenter mouseleave",f.event.hover).on("click",f.dismiss),i.context==t&&"fixed"==i.position&&p.addClass(b.fixed),i.sticky&&("absolute"==i.position?h.on("scroll resize",f.event.scroll):e(t).on("scroll resize",f.event.scroll),e.proxy(f.event.scroll,this)()),i.followLink&&p.on("mouseenter mouseleave",f.event.hover).on("click",f.followLink),i.displayTime>0&&setTimeout(f.hide,i.displayTime),f.should.show()?p.is(":visible")||f.show():f.hide()},refresh:function(){n=p.offset(),r=p.outerHeight(),s=h.outerWidth(),c=h.outerHeight(),l=h.offset()},show:function(){e.fn.popIn!==o?p.popIn(i.duration):p.fadeIn(i.duration,i.easing)},hide:function(){p.fadeOut(i.duration,i.easing)},stick:function(){if(f.refresh(),"fixed"==i.position){var n=e(t).prop("pageYOffset")||e(t).scrollTop(),o=p.hasClass(b.bottom)?l.top+(c-r)-n:l.top-n;p.css({position:"fixed",top:o,left:l.left,width:s-i.scrollBarWidth})}else p.css({top:d})},unStick:function(){p.css({top:""})},dismiss:function(){i.storageMethod&&f.storage.set(i.storedKey,i.storedValue),f.hide()},should:{show:function(){return f.storage.get(i.storedKey)==i.storedValue?!1:!0},stick:function(){return u=h.prop("pageYOffset")||h.scrollTop(),d=p.hasClass(b.bottom)?c-p.outerHeight()+u:u,d>n.top?!0:"fixed"==i.position?!0:!1}},followLink:function(){e.fn.followLink!==o&&p.followLink()},storage:{set:function(t,n){"local"==i.storageMethod&&store!==o?store.set(t,n):e.cookie!==o?e.cookie(t,n):f.error(i.errors.noStorage)},get:function(t){return"local"==i.storageMethod&&store!==o?store.get(t):e.cookie!==o?e.cookie(t):(f.error(i.errors.noStorage),o)}},event:{hover:function(){e(this).toggleClass(b.hover)},scroll:function(){m!==o&&clearTimeout(m),m=setTimeout(function(){f.should.stick()?y(f.stick):f.unStick()},i.lag)}},error:function(e){console.log("Nag Module:"+e)},invoke:function(t,n,a){var r;return a=a||Array.prototype.slice.call(arguments,2),"string"==typeof t&&v!==o&&(t=t.split("."),e.each(t,function(t,n){return e.isPlainObject(v[n])?(v=v[n],!0):e.isFunction(v[n])?(r=v[n],!0):(f.error(i.errors.method),!1)})),e.isFunction(r)?r.apply(n,a):r}},v!==o&&a?("invoke"==a[0]&&(a=Array.prototype.slice.call(a,1)),f.invoke(a[0],this,Array.prototype.slice.call(a,1))):(f.initialize(),o)}),this},e.fn.nag.settings={displayTime:0,followLink:!0,position:"fixed",scrollBarWidth:18,storageMethod:"cookie",storedKey:"nag",storedValue:"dismiss",sticky:!0,lag:0,context:t,errors:{noStorage:"Neither $.cookie or store is defined. A storage solution is required for storing state",followLink:"Follow link is set but the plugin is not included"},className:{bottom:"bottom",hover:"hover",fixed:"fixed"},selector:{close:".icon.close"},speed:500,easing:"easeOutQuad"}})(jQuery,window,document); \ No newline at end of file diff --git a/build/minified/modules/popup.min.js b/build/minified/modules/popup.min.js index 4c302b865..28e56634c 100644 --- a/build/minified/modules/popup.min.js +++ b/build/minified/modules/popup.min.js @@ -1 +1 @@ -(function(e,t,n,o){e.fn.popup=function(i){var a,s=e(this),r=e.extend(!0,{},e.fn.popup.settings,i),c=("."+r.namespace,"module-"+r.namespace,s.selector||""),l=(new Date).getTime(),u=[],d=arguments[0],f="string"==typeof d,m=[].slice.call(arguments,1);return s.each(function(){var i,p=e(this),g=e(t),h=p.offsetParent(),v=r.inline?p.next(r.selector.popup):g.children(r.selector.popup).last(),b=0,y=this,x=p.data("module-"+r.namespace),w=r.selector,C=r.className,k=r.error,T=r.metadata,z=r.namespace;i={initialize:function(){"hover"==r.on?p.on("mouseenter."+z,i.event.mouseenter).on("mouseleave."+z,i.event.mouseleave):p.on(r.on+"."+z,i.event[r.on]),g.on("resize."+z,i.event.resize),p.data("module-"+z,i)},refresh:function(){v=r.inline?p.next(w.popup):g.children(w.popup).last(),h=p.offsetParent()},destroy:function(){i.debug("Destroying existing popups"),p.off("."+z),v.remove()},event:{mouseenter:function(t){var n=this;i.timer=setTimeout(function(){e.proxy(i.toggle,n)(),e(n).hasClass(C.visible)&&t.stopPropagation()},r.delay)},mouseleave:function(){clearTimeout(i.timer),p.is(":visible")&&i.hide()},click:function(t){e.proxy(i.toggle,this)(),e(this).hasClass(C.visible)&&t.stopPropagation()},resize:function(){v.is(":visible")&&i.position()}},create:function(){i.debug("Creating pop-up content");var t=p.data(T.html)||r.html,n=p.data(T.title)||r.title,o=p.data(T.content)||p.attr("title")||r.content;t||o||n?(t||(t=r.template({title:n,content:o})),v=e("
").addClass(C.popup).html(t),r.inline?v.insertAfter(p):v.appendTo(e("body"))):i.error(k.content)},remove:function(){v.remove()},get:{offstagePosition:function(){var n={top:e(t).scrollTop(),bottom:e(t).scrollTop()+e(t).height(),left:0,right:e(t).width()},o={width:v.outerWidth(),height:v.outerHeight(),position:v.offset()},i={},a=[];return o.position&&(i={top:o.position.topn.bottom,right:o.position.left+o.width>n.right,left:o.position.left0?a.join(" "):!1},nextPosition:function(e){switch(e){case"top left":e="bottom left";break;case"bottom left":e="top right";break;case"top right":e="bottom right";break;case"bottom right":e="top center";break;case"top center":e="bottom center";break;case"bottom center":e="right center";break;case"right center":e="left center";break;case"left center":e="top center"}return e}},toggle:function(){p=e(this),i.debug("Toggling pop-up"),i.refresh(),0===v.size()&&i.create(),p.hasClass(C.visible)?i.hide():i.position()&&i.show()},position:function(n,o){var a,s,c=(e(t).width(),e(t).height(),p.outerWidth()),l=p.outerHeight(),u=v.outerWidth(),d=v.outerHeight(),f=r.inline?p.position():p.offset(),m=r.inline?h.outerWidth():g.outerWidth(),y=r.inline?h.outerHeight():g.outerHeight();switch(n=n||p.data(T.position)||r.position,o=o||p.data(T.arrowOffset)||r.arrowOffset,i.debug("Calculating offset for position",n),n){case"top left":a={top:"auto",bottom:y-f.top+r.distanceAway,left:f.left+o};break;case"top center":a={bottom:y-f.top+r.distanceAway,left:f.left+c/2-u/2+o,top:"auto",right:"auto"};break;case"top right":a={bottom:y-f.top+r.distanceAway,right:m-f.left-c-o,top:"auto",left:"auto"};break;case"left center":a={top:f.top+l/2-d/2,right:m-f.left+r.distanceAway-o,left:"auto",bottom:"auto"};break;case"right center":a={top:f.top+l/2-d/2,left:f.left+c+r.distanceAway+o,bottom:"auto",right:"auto"};break;case"bottom left":a={top:f.top+l+r.distanceAway,left:f.left+o,bottom:"auto",right:"auto"};break;case"bottom center":a={top:f.top+l+r.distanceAway,left:f.left+c/2-u/2+o,bottom:"auto",right:"auto"};break;case"bottom right":a={top:f.top+l+r.distanceAway,right:m-f.left-c-o,left:"auto",bottom:"auto"}}return e.extend(a,{width:v.width()+1}),v.removeAttr("style").removeClass("top right bottom left center").css(a).addClass(n).addClass(C.loading),s=i.get.offstagePosition(),s?(i.debug("Element is outside boundaries ",s),r.maxSearchDepth>b?(n=i.get.nextPosition(n),b++,i.debug("Trying new position: ",n),i.position(n)):(i.error(k.recursion),b=0,!1)):(i.debug("Position is on stage",n),b=0,!0)},show:function(){i.debug("Showing pop-up"),e(w.popup).filter(":visible").stop().fadeOut(200).prev(p).removeClass(C.visible),p.addClass(C.visible),v.removeClass(C.loading),"pop"==r.animation&&e.fn.popIn!==o?v.stop().popIn(r.duration,r.easing):v.stop().fadeIn(r.duration,r.easing),"click"==r.on&&r.clicktoClose&&(i.debug("Binding popup close event"),e(n).on("click."+z,i.gracefully.hide)),e.proxy(r.onShow,v)()},hide:function(){p.removeClass(C.visible),v.is(":visible")&&(i.debug("Hiding pop-up"),"pop"==r.animation&&e.fn.popOut!==o?v.stop().popOut(r.duration,r.easing,function(){v.hide()}):v.stop().fadeOut(r.duration,r.easing)),"click"==r.on&&r.clicktoClose&&e(n).off("click."+z),e.proxy(r.onHide,v)(),r.inline||i.remove()},gracefully:{hide:function(t){0===e(t.target).closest(w.popup).size()&&i.hide()}},setting:function(t,n){return n===o?r[t]:(e.isPlainObject(t)?e.extend(!0,r,t):r[t]=n,o)},internal:function(t,n){return n===o?i[t]:(e.isPlainObject(t)?e.extend(!0,i,t):i[t]=n,o)},debug:function(){r.debug&&(r.performance?i.performance.log(arguments):i.debug=Function.prototype.bind.call(console.info,console,r.moduleName+":"))},verbose:function(){r.verbose&&r.debug&&(r.performance?i.performance.log(arguments):i.verbose=Function.prototype.bind.call(console.info,console,r.moduleName+":"))},error:function(){i.error=Function.prototype.bind.call(console.log,console,r.moduleName+":")},performance:{log:function(e){var t,n,o;r.performance&&(t=(new Date).getTime(),o=l||t,n=t-o,l=t,u.push({Element:y,Name:e[0],Arguments:e[1]||"None","Execution Time":n}),clearTimeout(i.performance.timer),i.performance.timer=setTimeout(i.performance.display,100))},display:function(){var t=r.moduleName,n=(r.moduleName+": "+c+"("+s.size()+" elements)",0);c&&(t+=" Performance ("+c+")"),(console.group!==o||console.table!==o)&&u.length>0&&(console.groupCollapsed(t),console.table?(e.each(u,function(e,t){n+=t["Execution Time"]}),console.table(u)):e.each(u,function(e,t){n+=t["Execution Time"],console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.log("Total Execution Time:",n+"ms"),console.groupEnd(),u=[],l=!1)}},invoke:function(t,n,a){var s,r;return n=n||m,a=y||a,"string"==typeof t&&x!==o&&(t=t.split("."),s=t.length-1,e.each(t,function(t,n){return e.isPlainObject(x[n])&&t!=s?(x=x[n],!0):x[n]!==o?(r=x[n],!0):(i.error(k.method),!1)})),e.isFunction(r)?(i.verbose("Executing invoked function",r),r.apply(a,n)):r||!1}},f?(x===o&&i.initialize(),a=i.invoke(d)):(x!==o&&i.destroy(),i.initialize())}),a?a:this},e.fn.popup.settings={moduleName:"Pop-up Module",debug:!0,verbose:!0,performance:!0,namespace:"popup",onShow:function(){},onHide:function(){},content:!1,html:!1,title:!1,on:"hover",clicktoClose:!0,position:"top center",delay:0,inline:!0,duration:250,easing:"easeOutQuint",animation:"pop",distanceAway:2,arrowOffset:0,maxSearchDepth:10,error:{content:"Warning: Your popup has no content specified",method:"The method you called is not defined.",recursion:"Popup attempted to reposition element to fit, but could not find an adequate position."},metadata:{content:"content",html:"html",title:"title",position:"position",arrowOffset:"arrowOffset"},className:{popup:"ui popup",visible:"visible",loading:"loading"},selector:{popup:".ui.popup"},template:function(e){var t="";return typeof e!==o&&(typeof e.title!==o&&e.title&&(t+="

"+e.title+"

"),typeof e.content!==o&&e.content&&(t+='
'+e.content+"
")),t}}})(jQuery,window,document); \ No newline at end of file +(function(e,t,n,o){e.fn.popup=function(i){var a,r=e(this),s=e.extend(!0,{},e.fn.popup.settings,i),c=("."+s.namespace,"module-"+s.namespace,r.selector||""),l=(new Date).getTime(),u=[],d=arguments[0],f="string"==typeof d,m=[].slice.call(arguments,1);return r.each(function(){var i,p=e(this),g=e(t),h=p.offsetParent(),v=s.inline?p.next(s.selector.popup):g.children(s.selector.popup).last(),b=0,y=this,x=p.data("module-"+s.namespace),w=s.selector,C=s.className,k=s.error,T=s.metadata,N=s.namespace;i={initialize:function(){"hover"==s.on?p.on("mouseenter."+N,i.event.mouseenter).on("mouseleave."+N,i.event.mouseleave):p.on(s.on+"."+N,i.event[s.on]),g.on("resize."+N,i.event.resize),p.data("module-"+N,i)},refresh:function(){v=s.inline?p.next(w.popup):g.children(w.popup).last(),h=p.offsetParent()},destroy:function(){i.debug("Destroying existing popups"),p.off("."+N),v.remove()},event:{mouseenter:function(t){var n=this;i.timer=setTimeout(function(){e.proxy(i.toggle,n)(),e(n).hasClass(C.visible)&&t.stopPropagation()},s.delay)},mouseleave:function(){clearTimeout(i.timer),p.is(":visible")&&i.hide()},click:function(t){e.proxy(i.toggle,this)(),e(this).hasClass(C.visible)&&t.stopPropagation()},resize:function(){v.is(":visible")&&i.position()}},create:function(){i.debug("Creating pop-up content");var t=p.data(T.html)||s.html,n=p.data(T.title)||s.title,o=p.data(T.content)||p.attr("title")||s.content;t||o||n?(t||(t=s.template({title:n,content:o})),v=e("
").addClass(C.popup).html(t),s.inline?v.insertAfter(p):v.appendTo(e("body"))):i.error(k.content)},remove:function(){v.remove()},get:{offstagePosition:function(){var n={top:e(t).scrollTop(),bottom:e(t).scrollTop()+e(t).height(),left:0,right:e(t).width()},o={width:v.outerWidth(),height:v.outerHeight(),position:v.offset()},i={},a=[];return o.position&&(i={top:o.position.topn.bottom,right:o.position.left+o.width>n.right,left:o.position.left0?a.join(" "):!1},nextPosition:function(e){switch(e){case"top left":e="bottom left";break;case"bottom left":e="top right";break;case"top right":e="bottom right";break;case"bottom right":e="top center";break;case"top center":e="bottom center";break;case"bottom center":e="right center";break;case"right center":e="left center";break;case"left center":e="top center"}return e}},toggle:function(){p=e(this),i.debug("Toggling pop-up"),i.refresh(),0===v.size()&&i.create(),p.hasClass(C.visible)?i.hide():i.position()&&i.show()},position:function(n,o){var a,r,c=(e(t).width(),e(t).height(),p.outerWidth()),l=p.outerHeight(),u=v.outerWidth(),d=v.outerHeight(),f=s.inline?p.position():p.offset(),m=s.inline?h.outerWidth():g.outerWidth(),y=s.inline?h.outerHeight():g.outerHeight();switch(n=n||p.data(T.position)||s.position,o=o||p.data(T.arrowOffset)||s.arrowOffset,i.debug("Calculating offset for position",n),n){case"top left":a={top:"auto",bottom:y-f.top+s.distanceAway,left:f.left+o};break;case"top center":a={bottom:y-f.top+s.distanceAway,left:f.left+c/2-u/2+o,top:"auto",right:"auto"};break;case"top right":a={bottom:y-f.top+s.distanceAway,right:m-f.left-c-o,top:"auto",left:"auto"};break;case"left center":a={top:f.top+l/2-d/2,right:m-f.left+s.distanceAway-o,left:"auto",bottom:"auto"};break;case"right center":a={top:f.top+l/2-d/2,left:f.left+c+s.distanceAway+o,bottom:"auto",right:"auto"};break;case"bottom left":a={top:f.top+l+s.distanceAway,left:f.left+o,bottom:"auto",right:"auto"};break;case"bottom center":a={top:f.top+l+s.distanceAway,left:f.left+c/2-u/2+o,bottom:"auto",right:"auto"};break;case"bottom right":a={top:f.top+l+s.distanceAway,right:m-f.left-c-o,left:"auto",bottom:"auto"}}return e.extend(a,{width:v.width()+1}),v.removeAttr("style").removeClass("top right bottom left center").css(a).addClass(n).addClass(C.loading),r=i.get.offstagePosition(),r?(i.debug("Element is outside boundaries ",r),s.maxSearchDepth>b?(n=i.get.nextPosition(n),b++,i.debug("Trying new position: ",n),i.position(n)):(i.error(k.recursion),b=0,!1)):(i.debug("Position is on stage",n),b=0,!0)},show:function(){i.debug("Showing pop-up"),e(w.popup).filter(":visible").stop().fadeOut(200).prev(p).removeClass(C.visible),p.addClass(C.visible),v.removeClass(C.loading),"pop"==s.animation&&e.fn.popIn!==o?v.stop().popIn(s.duration,s.easing):v.stop().fadeIn(s.duration,s.easing),"click"==s.on&&s.clicktoClose&&(i.debug("Binding popup close event"),e(n).on("click."+N,i.gracefully.hide)),e.proxy(s.onShow,v)()},hide:function(){p.removeClass(C.visible),v.is(":visible")&&(i.debug("Hiding pop-up"),"pop"==s.animation&&e.fn.popOut!==o?v.stop().popOut(s.duration,s.easing,function(){v.hide()}):v.stop().fadeOut(s.duration,s.easing)),"click"==s.on&&s.clicktoClose&&e(n).off("click."+N),e.proxy(s.onHide,v)(),s.inline||i.remove()},gracefully:{hide:function(t){0===e(t.target).closest(w.popup).size()&&i.hide()}},setting:function(t,n){return n===o?s[t]:(e.isPlainObject(t)?e.extend(!0,s,t):s[t]=n,o)},internal:function(t,n){return n===o?i[t]:(e.isPlainObject(t)?e.extend(!0,i,t):i[t]=n,o)},debug:function(){s.debug&&(s.performance?i.performance.log(arguments):i.debug=Function.prototype.bind.call(console.info,console,s.moduleName+":"))},verbose:function(){s.verbose&&s.debug&&(s.performance?i.performance.log(arguments):i.verbose=Function.prototype.bind.call(console.info,console,s.moduleName+":"))},error:function(){i.error=Function.prototype.bind.call(console.log,console,s.moduleName+":")},performance:{log:function(e){var t,n,o;s.performance&&(t=(new Date).getTime(),o=l||t,n=t-o,l=t,u.push({Element:y,Name:e[0],Arguments:e[1]||"None","Execution Time":n}),clearTimeout(i.performance.timer),i.performance.timer=setTimeout(i.performance.display,100))},display:function(){var t=s.moduleName,n=(s.moduleName+": "+c+"("+r.size()+" elements)",0);c&&(t+=" Performance ("+c+")"),(console.group!==o||console.table!==o)&&u.length>0&&(console.groupCollapsed(t),console.table?(e.each(u,function(e,t){n+=t["Execution Time"]}),console.table(u)):e.each(u,function(e,t){n+=t["Execution Time"],console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.log("Total Execution Time:",n+"ms"),console.groupEnd(),u=[],l=!1)}},invoke:function(t,n,a){var r,s;return n=n||m,a=y||a,"string"==typeof t&&x!==o&&(t=t.split("."),r=t.length-1,e.each(t,function(t,n){return e.isPlainObject(x[n])&&t!=r?(x=x[n],!0):x[n]!==o?(s=x[n],!0):(i.error(k.method),!1)})),e.isFunction(s)?(i.verbose("Executing invoked function",s),s.apply(a,n)):s||!1}},f?(x===o&&i.initialize(),a=i.invoke(d)):(x!==o&&i.destroy(),i.initialize())}),a?a:this},e.fn.popup.settings={moduleName:"Pop-up Module",debug:!0,verbose:!0,performance:!0,namespace:"popup",onShow:function(){},onHide:function(){},content:!1,html:!1,title:!1,on:"hover",clicktoClose:!0,position:"top center",delay:0,inline:!0,duration:250,easing:"easeOutQuint",animation:"pop",distanceAway:2,arrowOffset:0,maxSearchDepth:10,error:{content:"Warning: Your popup has no content specified",method:"The method you called is not defined.",recursion:"Popup attempted to reposition element to fit, but could not find an adequate position."},metadata:{content:"content",html:"html",title:"title",position:"position",arrowOffset:"arrowOffset"},className:{popup:"ui popup",visible:"visible",loading:"loading"},selector:{popup:".ui.popup"},template:function(e){var t="";return typeof e!==o&&(typeof e.title!==o&&e.title&&(t+="

"+e.title+"

"),typeof e.content!==o&&e.content&&(t+='
'+e.content+"
")),t}}})(jQuery,window,document); \ No newline at end of file diff --git a/build/minified/modules/search.min.js b/build/minified/modules/search.min.js index aaab57e14..4b1a7edec 100644 --- a/build/minified/modules/search.min.js +++ b/build/minified/modules/search.min.js @@ -1 +1 @@ -(function(e,t,n,o){e.fn.searchPrompt=function(n,i){var a,s=e.extend(!0,{},e.fn.searchPrompt.settings,i),r=arguments[0],l=[].slice.call(arguments,1);return e(this).each(function(){var i,c=e(this),u=c.find(s.selector.searchPrompt),d=c.find(s.selector.searchButton),f=c.find(s.selector.searchResults),m=(c.find(s.selector.result),c.find(s.selector.category),c.find(s.selector.emptyResult),c.find(s.selector.resultPage),this),p=(c.selector||"",c.data("module-"+s.namespace)),g=p!==o&&"string"==typeof r,h=s.className,v=s.namespace,b=s.errors;i={initialize:function(){var e=u[0],t=e.oninput!==o?"input":e.onpropertychange!==o?"propertychange":"keyup";u.on("focus."+v,i.event.focus).on("blur."+v,i.event.blur).on("keydown."+v,i.handleKeyboard),s.automatic&&u.on(t+"."+v,i.search.throttle),d.on("click."+v,i.search.query),f.on("click."+v,s.selector.result,i.results.select),c.data("module-"+v,i)},event:{focus:function(){c.addClass(h.focus),i.results.show()},blur:function(){i.search.cancel(),c.removeClass(h.focus),i.results.hide()}},handleKeyboard:function(t){var n,o=c.find(s.selector.result),a=c.find(s.selector.category),r=t.which,l={backspace:8,enter:13,escape:27,upArrow:38,downArrow:40},m=h.active,p=o.index(o.filter("."+m)),g=o.size();if(r==l.escape&&u.trigger("blur"),f.filter(":visible").size()>0)if(r==l.enter){if(o.filter("."+m).exists())return e.proxy(i.results.select,o.filter("."+m))(),t.preventDefault(),!1}else r==l.upArrow?(n=0>p-1?p:p-1,a.removeClass(m),o.removeClass(m).eq(n).addClass(m).closest(a).addClass(m),t.preventDefault()):r==l.downArrow&&(n=p+1>=g?p:p+1,a.removeClass(m),o.removeClass(m).eq(n).addClass(m).closest(a).addClass(m),t.preventDefault());else r==l.enter&&(i.search.query(),d.addClass(h.down),u.one("keyup",function(){d.removeClass(h.down)}))},search:{cancel:function(){var e=c.data("xhr")||!1;e&&"resolved"!=e.state()&&e.abort()},throttle:function(){var e,t=u.val(),n=t.length;clearTimeout(c.data("timer")),n>=s.minCharacters?(e=setTimeout(i.search.query,s.searchThrottle),c.data("timer",e)):i.results.hide()},query:function(){var t=u.val(),o=i.search.cache.read(t);o?(i.debug("Reading result for '"+t+"' from cache"),i.results.add(o)):(i.debug("Querying for '"+t+"'"),"object"==typeof n?i.search.local(t):i.search.remote(t),e.proxy(s.onSearchQuery,c)(t))},local:function(t){var o,a=[],r=[],l=e.isArray(s.searchFields)?s.searchFields:[s.searchFields],u=RegExp("(?:s|^)"+t,"i"),d=RegExp(t,"i");c.addClass(h.loading),e.each(l,function(t,o){e.each(n,function(t,n){"string"==typeof n[o]&&-1==e.inArray(n,a)&&-1==e.inArray(n,r)&&(u.test(n[o])?a.push(n):d.test(n[o])&&r.push(n))})}),o=i.results.generate({results:e.merge(a,r)}),c.removeClass(h.loading),i.search.cache.write(t,o),i.results.add(o)},remote:function(t){var a,r=c.data("xhr")!==o?c.data("xhr"):!1,l={stateContext:c,url:n,urlData:{query:t},success:function(e){a=i.results.generate(e),i.search.cache.write(t,a),i.results.add(a)},failure:i.error};r&&"resolved"!=r.state()&&r.abort(),e.extend(!0,l,s.apiSettings),e.api(l)},cache:{read:function(e){var t=c.data("cache");return s.cache&&"object"==typeof t&&t[e]!==o?t[e]:!1},write:function(e,t){var n=c.data("cache")!==o?c.data("cache"):{};n[e]=t,c.data("cache",n)}}},results:{generate:function(t){i.debug("Generating html from response",t);var n=s.templates[s.type],o="";return e.isPlainObject(t.results)&&!e.isEmptyObject(t.results)||e.isArray(t.results)&&t.results.length>0?(s.maxResults>0&&(t.results=e.makeArray(t.results).slice(0,s.maxResults)),t.results.length>0&&(e.isFunction(n)?o=n(t):i.error(b.noTemplate,!1))):o=i.message(b.noResults,"empty"),e.proxy(s.onSearchResults,c)(t),o},add:function(t){("default"==s.onResultsAdd||"default"==e.proxy(s.onResultsAdd,f)(t))&&f.html(t),i.results.show()},show:function(){0===f.filter(":visible").size()&&u.filter(":focus").size()>0&&""!==f.html()&&(f.stop().fadeIn(200),e.proxy(s.onResultsOpen,f)())},hide:function(){f.filter(":visible").size()>0&&(f.stop().fadeOut(200),e.proxy(s.onResultsClose,f)())},followLink:function(){},select:function(n){i.debug("Search result selected");var o=e(this),a=o.find(".title"),r=a.html();if("default"==s.onSelect||"default"==e.proxy(s.onSelect,this)(n)){var l=o.find("a[href]").eq(0),c=l.attr("href"),d=l.attr("target");try{i.results.hide(),u.val(r),"_blank"==d||n.ctrlKey?t.open(c):t.location.href=c}catch(f){}}}},setting:function(e,t){return t===o?s[e]:(s[e]=t,o)},debug:function(){var e=[],t=s.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.info||console.log||function(){};o=Function.prototype.bind.call(o,console),s.debug&&(e.push(t),o.apply(console,e.concat(n)))},message:function(e,t){return t=t||"standard",i.results.add(s.templates.message(e,t)),s.templates.message(e,t)},error:function(e,t){t=t!==o?t:!0,console.warn(s.moduleName+": "+e),t&&e!==o&&i.message(e,"error")},invoke:function(t,n,a){var s,r;return a=a||[].slice.call(arguments,2),"string"==typeof t&&p!==o&&(t=t.split("."),s=t.length-1,e.each(t,function(t,n){return e.isPlainObject(p[n])&&t!=s?(p=p[n],!0):p[n]!==o?(r=p[n],!0):(i.error(b.method),!1)})),e.isFunction(r)?r.apply(n,a):r}},g?a=i.invoke(r,m,l):i.initialize()}),a!==o?a:this},e.fn.searchPrompt.settings={moduleName:"Search Module",debug:!0,namespace:"search",onSelect:"default",onResultsAdd:"default",onSearchQuery:function(){},onSearchResults:function(){},onResultsOpen:function(){},onResultsClose:function(){},automatic:"true",type:"simple",minCharacters:3,searchThrottle:300,maxResults:7,cache:!0,searchFields:["title","description"],apiSettings:{},className:{active:"active",down:"down",focus:"focus",empty:"empty",loading:"loading"},errors:{noResults:"Your search returned no results",logging:"Error in debug logging, exiting.",noTemplate:"A valid template name was not specified.",serverError:"There was an issue with querying the server.",method:"The method you called is not defined."},selector:{searchPrompt:".prompt",searchButton:".search.button",searchResults:".results",category:".category",result:".result",emptyResult:".results .message",resultPage:".results .page"},templates:{message:function(e,t){var n="";return e!==o&&t!==o&&(n+='
'+'
',n+="empty"==t?"

No Results

"+e+"

":'
'+e+"
",n+="
"),n},categories:function(t){var n="";return t.results!==o?(e.each(t.results,function(t,i){i.results!==o&&i.results.length>0&&(n+='
'+i.name+"
"+"
    ",e.each(i.results,function(e,t){n+='
  • ',n+='',t.image!==o&&(n+='
    '+"
    "),n+=t.image!==o?'
    ':'
    ',t.price!==o&&(n+='
    '+t.price+"
    "),t.title!==o&&(n+='
    '+t.title+"
    "),t.description!==o&&(n+='
    '+t.description+"
    "),n+="
  • "}),n+="
")}),t.resultPage&&(n+=''+t.resultPage.text+""),n):!1},simple:function(t){var n="";return t.results!==o?(n+="
    ",e.each(t.results,function(e,t){n+='
  • ',t.url!==o&&(n+=''),t.image!==o&&(n+='
    '+"
    "),n+=t.image!==o?'
    ':'
    ',t.price!==o&&(n+='
    '+t.price+"
    "),t.title!==o&&(n+='
    '+t.title+"
    "),t.description!==o&&(n+='
    '+t.description+"
    "),n+="
  • "}),n+="
",t.resultPage&&(n+=''+t.resultPage.text+""),n):!1}}}})(jQuery,window,document); \ No newline at end of file +(function(e,t,n,o){e.fn.searchPrompt=function(n,i){var a,s=e.extend(!0,{},e.fn.searchPrompt.settings,i),r=arguments[0],c=[].slice.call(arguments,1);return e(this).each(function(){var i,l=e(this),u=l.find(s.selector.searchPrompt),d=l.find(s.selector.searchButton),f=l.find(s.selector.searchResults),m=(l.find(s.selector.result),l.find(s.selector.category),l.find(s.selector.emptyResult),l.find(s.selector.resultPage),this),p=(l.selector||"",l.data("module-"+s.namespace)),g=p!==o&&"string"==typeof r,h=s.className,v=s.namespace,b=s.errors;i={initialize:function(){var e=u[0],t=e.oninput!==o?"input":e.onpropertychange!==o?"propertychange":"keyup";u.on("focus."+v,i.event.focus).on("blur."+v,i.event.blur).on("keydown."+v,i.handleKeyboard),s.automatic&&u.on(t+"."+v,i.search.throttle),d.on("click."+v,i.search.query),f.on("click."+v,s.selector.result,i.results.select),l.data("module-"+v,i)},event:{focus:function(){l.addClass(h.focus),i.results.show()},blur:function(){i.search.cancel(),l.removeClass(h.focus),i.results.hide()}},handleKeyboard:function(t){var n,o=l.find(s.selector.result),a=l.find(s.selector.category),r=t.which,c={backspace:8,enter:13,escape:27,upArrow:38,downArrow:40},m=h.active,p=o.index(o.filter("."+m)),g=o.size();if(r==c.escape&&u.trigger("blur"),f.filter(":visible").size()>0)if(r==c.enter){if(o.filter("."+m).exists())return e.proxy(i.results.select,o.filter("."+m))(),t.preventDefault(),!1}else r==c.upArrow?(n=0>p-1?p:p-1,a.removeClass(m),o.removeClass(m).eq(n).addClass(m).closest(a).addClass(m),t.preventDefault()):r==c.downArrow&&(n=p+1>=g?p:p+1,a.removeClass(m),o.removeClass(m).eq(n).addClass(m).closest(a).addClass(m),t.preventDefault());else r==c.enter&&(i.search.query(),d.addClass(h.down),u.one("keyup",function(){d.removeClass(h.down)}))},search:{cancel:function(){var e=l.data("xhr")||!1;e&&"resolved"!=e.state()&&e.abort()},throttle:function(){var e,t=u.val(),n=t.length;clearTimeout(l.data("timer")),n>=s.minCharacters?(e=setTimeout(i.search.query,s.searchThrottle),l.data("timer",e)):i.results.hide()},query:function(){var t=u.val(),o=i.search.cache.read(t);o?(i.debug("Reading result for '"+t+"' from cache"),i.results.add(o)):(i.debug("Querying for '"+t+"'"),"object"==typeof n?i.search.local(t):i.search.remote(t),e.proxy(s.onSearchQuery,l)(t))},local:function(t){var o,a=[],r=[],c=e.isArray(s.searchFields)?s.searchFields:[s.searchFields],u=RegExp("(?:s|^)"+t,"i"),d=RegExp(t,"i");l.addClass(h.loading),e.each(c,function(t,o){e.each(n,function(t,n){"string"==typeof n[o]&&-1==e.inArray(n,a)&&-1==e.inArray(n,r)&&(u.test(n[o])?a.push(n):d.test(n[o])&&r.push(n))})}),o=i.results.generate({results:e.merge(a,r)}),l.removeClass(h.loading),i.search.cache.write(t,o),i.results.add(o)},remote:function(t){var a,r=l.data("xhr")!==o?l.data("xhr"):!1,c={stateContext:l,url:n,urlData:{query:t},success:function(e){a=i.results.generate(e),i.search.cache.write(t,a),i.results.add(a)},failure:i.error};r&&"resolved"!=r.state()&&r.abort(),e.extend(!0,c,s.apiSettings),e.api(c)},cache:{read:function(e){var t=l.data("cache");return s.cache&&"object"==typeof t&&t[e]!==o?t[e]:!1},write:function(e,t){var n=l.data("cache")!==o?l.data("cache"):{};n[e]=t,l.data("cache",n)}}},results:{generate:function(t){i.debug("Generating html from response",t);var n=s.templates[s.type],o="";return e.isPlainObject(t.results)&&!e.isEmptyObject(t.results)||e.isArray(t.results)&&t.results.length>0?(s.maxResults>0&&(t.results=e.makeArray(t.results).slice(0,s.maxResults)),t.results.length>0&&(e.isFunction(n)?o=n(t):i.error(b.noTemplate,!1))):o=i.message(b.noResults,"empty"),e.proxy(s.onSearchResults,l)(t),o},add:function(t){("default"==s.onResultsAdd||"default"==e.proxy(s.onResultsAdd,f)(t))&&f.html(t),i.results.show()},show:function(){0===f.filter(":visible").size()&&u.filter(":focus").size()>0&&""!==f.html()&&(f.stop().fadeIn(200),e.proxy(s.onResultsOpen,f)())},hide:function(){f.filter(":visible").size()>0&&(f.stop().fadeOut(200),e.proxy(s.onResultsClose,f)())},followLink:function(){},select:function(n){i.debug("Search result selected");var o=e(this),a=o.find(".title"),r=a.html();if("default"==s.onSelect||"default"==e.proxy(s.onSelect,this)(n)){var c=o.find("a[href]").eq(0),l=c.attr("href"),d=c.attr("target");try{i.results.hide(),u.val(r),"_blank"==d||n.ctrlKey?t.open(l):t.location.href=l}catch(f){}}}},setting:function(e,t){return t===o?s[e]:(s[e]=t,o)},debug:function(){var e=[],t=s.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.info||console.log||function(){};o=Function.prototype.bind.call(o,console),s.debug&&(e.push(t),o.apply(console,e.concat(n)))},message:function(e,t){return t=t||"standard",i.results.add(s.templates.message(e,t)),s.templates.message(e,t)},error:function(e,t){t=t!==o?t:!0,console.warn(s.moduleName+": "+e),t&&e!==o&&i.message(e,"error")},invoke:function(t,n,a){var s,r;return a=a||[].slice.call(arguments,2),"string"==typeof t&&p!==o&&(t=t.split("."),s=t.length-1,e.each(t,function(t,n){return e.isPlainObject(p[n])&&t!=s?(p=p[n],!0):p[n]!==o?(r=p[n],!0):(i.error(b.method),!1)})),e.isFunction(r)?r.apply(n,a):r}},g?a=i.invoke(r,m,c):i.initialize()}),a!==o?a:this},e.fn.searchPrompt.settings={moduleName:"Search Module",debug:!0,namespace:"search",onSelect:"default",onResultsAdd:"default",onSearchQuery:function(){},onSearchResults:function(){},onResultsOpen:function(){},onResultsClose:function(){},automatic:"true",type:"simple",minCharacters:3,searchThrottle:300,maxResults:7,cache:!0,searchFields:["title","description"],apiSettings:{},className:{active:"active",down:"down",focus:"focus",empty:"empty",loading:"loading"},errors:{noResults:"Your search returned no results",logging:"Error in debug logging, exiting.",noTemplate:"A valid template name was not specified.",serverError:"There was an issue with querying the server.",method:"The method you called is not defined."},selector:{searchPrompt:".prompt",searchButton:".search.button",searchResults:".results",category:".category",result:".result",emptyResult:".results .message",resultPage:".results .page"},templates:{message:function(e,t){var n="";return e!==o&&t!==o&&(n+='
'+'
',n+="empty"==t?"

No Results

"+e+"

":'
'+e+"
",n+="
"),n},categories:function(t){var n="";return t.results!==o?(e.each(t.results,function(t,i){i.results!==o&&i.results.length>0&&(n+='
'+i.name+"
"+"
    ",e.each(i.results,function(e,t){n+='
  • ',n+='',t.image!==o&&(n+='
    '+"
    "),n+=t.image!==o?'
    ':'
    ',t.price!==o&&(n+='
    '+t.price+"
    "),t.title!==o&&(n+='
    '+t.title+"
    "),t.description!==o&&(n+='
    '+t.description+"
    "),n+="
  • "}),n+="
")}),t.resultPage&&(n+=''+t.resultPage.text+""),n):!1},simple:function(t){var n="";return t.results!==o?(n+="
    ",e.each(t.results,function(e,t){n+='
  • ',t.url!==o&&(n+=''),t.image!==o&&(n+='
    '+"
    "),n+=t.image!==o?'
    ':'
    ',t.price!==o&&(n+='
    '+t.price+"
    "),t.title!==o&&(n+='
    '+t.title+"
    "),t.description!==o&&(n+='
    '+t.description+"
    "),n+="
  • "}),n+="
",t.resultPage&&(n+=''+t.resultPage.text+""),n):!1}}}})(jQuery,window,document); \ No newline at end of file diff --git a/build/minified/modules/shape.min.js b/build/minified/modules/shape.min.js index 47840a6bb..3de23f1ef 100644 --- a/build/minified/modules/shape.min.js +++ b/build/minified/modules/shape.min.js @@ -1 +1 @@ -(function(e,t,n,o){e.fn.shape=function(t){var i,a=e(this),s=e.extend(!0,{},e.fn.shape.settings,t),r="."+s.namespace,l="module-"+s.namespace,c=a.selector||"",u=(new Date).getTime(),d=[],f=arguments[0],m="string"==typeof f,p=[].slice.call(arguments,1);return a.each(function(){var t,g,h,v=e(this),b=v.find(s.selector.sides),y=v.find(s.selector.side),x="transitionend msTransitionEnd oTransitionEnd webkitTransitionEnd",w=this,C=v.data(l),k=(s.namespace,s.error),T=s.className;h={initialize:function(){h.verbose("Initializing module for",w),h.set.defaultSide(),C=h,v.data(l,C)},destroy:function(){h.verbose("Destroying previous module for",w),v.removeData(l).off(r)},refresh:function(){h.verbose("Refreshing selector cache for",w),v=e(w),b=e(this).find(s.selector.shape),y=e(this).find(s.selector.side)},repaint:function(){h.verbose("Forcing repaint event");var e=b.get(0)||n.createElement("div");e.offsetWidth},animate:function(n,o){h.verbose("Animating box with properties",n),o=o||function(t){h.reset(),h.set.active(),e.proxy(s.onChange,g)(),t.stopImmediatePropagation()},s.useCSS?(h.verbose("Starting CSS animation"),v.addClass(T.animating),h.set.stageSize(),h.repaint(),v.addClass(T.css),t.addClass(T.hidden),b.css(n).one(x,o)):(h.verbose("Starting javascript animation"),v.addClass(T.animating).removeClass(T.css),h.set.stageSize(),h.repaint(),t.animate({opacity:0},s.duration,s.easing),b.animate(n,s.duration,s.easing,o))},queue:function(e){h.debug("Queueing animation of",e),b.one(x,function(){h.debug("Executing queued animation"),v.shape(e)})},reset:function(){h.verbose("Animating states reset"),v.removeClass(T.css).removeClass(T.animating).removeAttr("style"),b.removeAttr("style"),y.removeAttr("style").removeClass(T.hidden),g.removeClass(T.animating).removeAttr("style")},is:{animating:function(){return v.hasClass(T.animating)}},get:{nextSide:function(){return t.next(s.selector.side).size()>0?t.next(s.selector.side):v.find(s.selector.side).first()}},set:{defaultSide:function(){t=v.find("."+s.className.active),g=t.next(s.selector.side).size()>0?t.next(s.selector.side):v.find(s.selector.side).first(),h.verbose("Active side set to",t),h.verbose("Next side set to",g)},stageSize:function(){var e={width:g.outerWidth(),height:g.outerHeight()};h.verbose("Resizing stage to fit new content",e),v.css({width:e.width,height:e.height})},nextSide:function(e){g=v.find(e),0===g.size()&&h.error(k.side),h.verbose("Next side manually set to",g)},active:function(){h.verbose("Setting new side to active",g),y.removeClass(T.active),g.addClass(T.active),h.set.defaultSide()}},flip:{up:function(){h.debug("Flipping up",g),h.is.animating()?h.queue("flip.up"):(h.stage.above(),h.animate(h.getTransform.up()))},down:function(){h.debug("Flipping down",g),h.is.animating()?h.queue("flip.down"):(h.stage.below(),h.animate(h.getTransform.down()))},left:function(){h.debug("Flipping left",g),h.is.animating()?h.queue("flip.left"):(h.stage.left(),h.animate(h.getTransform.left()))},right:function(){h.debug("Flipping right",g),h.is.animating()?h.queue("flip.right"):(h.stage.right(),h.animate(h.getTransform.right()))},over:function(){h.debug("Flipping over",g),h.is.animating()?h.queue("flip.over"):(h.stage.behind(),h.animate(h.getTransform.behind()))}},getTransform:{up:function(){var e={y:-((t.outerHeight()-g.outerHeight())/2),z:-(t.outerHeight()/2)};return{transform:"translateY("+e.y+"px) translateZ("+e.z+"px) rotateX(-90deg)"}},down:function(){var e={y:-((t.outerHeight()-g.outerHeight())/2),z:-(t.outerHeight()/2)};return{transform:"translateY("+e.y+"px) translateZ("+e.z+"px) rotateX(90deg)"}},left:function(){var e={x:-((t.outerWidth()-g.outerWidth())/2),z:-(t.outerWidth()/2)};return{transform:"translateX("+e.x+"px) translateZ("+e.z+"px) rotateY(90deg)"}},right:function(){var e={x:-((t.outerWidth()-g.outerWidth())/2),z:-(t.outerWidth()/2)};return{transform:"translateX("+e.x+"px) translateZ("+e.z+"px) rotateY(-90deg)"}},behind:function(){var e={x:-((t.outerWidth()-g.outerWidth())/2)};return{transform:"translateX("+e.x+"px) rotateY(180deg)"}}},stage:{above:function(){var e={origin:(t.outerHeight()-g.outerHeight())/2,depth:{active:g.outerHeight()/2,next:t.outerHeight()/2}};h.verbose("Setting the initial animation position as above",g,e),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),g.addClass(T.animating).css({display:"block",top:e.origin+"px",transform:"rotateX(90deg) translateZ("+e.depth.next+"px)"})},below:function(){var e={origin:(t.outerHeight()-g.outerHeight())/2,depth:{active:g.outerHeight()/2,next:t.outerHeight()/2}};h.verbose("Setting the initial animation position as below",g,e),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),g.addClass(T.animating).css({display:"block",top:e.origin+"px",transform:"rotateX(-90deg) translateZ("+e.depth.next+"px)"})},left:function(){var e={origin:(t.outerWidth()-g.outerWidth())/2,depth:{active:g.outerWidth()/2,next:t.outerWidth()/2}};h.verbose("Setting the initial animation position as left",g,e),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),g.addClass(T.animating).css({display:"block",left:e.origin+"px",transform:"rotateY(-90deg) translateZ("+e.depth.next+"px)"})},right:function(){var e={origin:(t.outerWidth()-g.outerWidth())/2,depth:{active:g.outerWidth()/2,next:t.outerWidth()/2}};h.verbose("Setting the initial animation position as left",g,e),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),g.addClass(T.animating).css({display:"block",left:e.origin+"px",transform:"rotateY(90deg) translateZ("+e.depth.next+"px)"})},behind:function(){var e={origin:(t.outerWidth()-g.outerWidth())/2,depth:{active:g.outerWidth()/2,next:t.outerWidth()/2}};h.verbose("Setting the initial animation position as behind",g,e),t.css({transform:"rotateY(0deg)"}),g.addClass(T.animating).css({display:"block",left:e.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(t,n){return n===o?s[t]:(e.isPlainObject(t)?(h.verbose("Modifying settings object",t,n),e.extend(!0,s,t)):(h.verbose("Modifying setting",t,n),s[t]=n),o)},internal:function(t,n){return n===o?h[t]:(e.isPlainObject(t)?(h.verbose("Modifying internal property",t,n),e.extend(!0,h,t)):(h.verbose("Changing internal method to",n),h[t]=n),o)},debug:function(){s.debug&&(s.performance?h.performance.log(arguments):h.debug=Function.prototype.bind.call(console.info,console,s.moduleName+":"))},verbose:function(){s.verbose&&s.debug&&(s.performance?h.performance.log(arguments):h.verbose=Function.prototype.bind.call(console.info,console,s.moduleName+":"))},error:function(){h.error=Function.prototype.bind.call(console.log,console,s.moduleName+":")},performance:{log:function(e){var t,n,o;s.performance&&(t=(new Date).getTime(),o=u||t,n=t-o,u=t,d.push({Element:w,Name:e[0],Arguments:e[1]||"None","Execution Time":n}),clearTimeout(h.performance.timer),h.performance.timer=setTimeout(h.performance.display,100))},display:function(){var t=s.moduleName,n=(s.moduleName+": "+c+"("+a.size()+" elements)",0);c&&(t+=" Performance ("+c+")"),(console.group!==o||console.table!==o)&&d.length>0&&(console.groupCollapsed(t),console.table?(e.each(d,function(e,t){n+=t["Execution Time"]}),console.table(d)):e.each(d,function(e,t){n+=t["Execution Time"],console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.log("Total Execution Time:",n+"ms"),console.groupEnd(),d=[],u=!1)}},invoke:function(t,n,i){var a,s;return n=n||p,i=w||i,"string"==typeof t&&C!==o&&(t=t.split("."),a=t.length-1,e.each(t,function(t,n){return e.isPlainObject(C[n])&&t!=a?(C=C[n],!0):C[n]!==o?(s=C[n],!0):(h.error(errors.method),!1)})),e.isFunction(s)?(h.verbose("Executing invoked function",s),s.apply(i,n)):s||!1}},m?(C===o&&h.initialize(),i=h.invoke(f)):(C!==o&&h.destroy(),h.initialize())}),i?i:this},e.fn.shape.settings={moduleName:"Shape Module",debug:!0,verbose:!0,performance:!0,namespace:"shape",beforeChange:function(){},onChange:function(){},useCSS:!0,duration:1e3,easing:"easeInOutQuad",error:{side:"You tried to switch to a side that does not exist.",method:"The method you called is not defined"},className:{css:"css",animating:"animating",hidden:"hidden",active:"active"},selector:{sides:".sides",side:".side"}}})(jQuery,window,document); \ No newline at end of file +(function(e,t,n,o){e.fn.shape=function(t){var i,a=e(this),s=e.extend(!0,{},e.fn.shape.settings,t),r="."+s.namespace,c="module-"+s.namespace,l=a.selector||"",u=(new Date).getTime(),d=[],f=arguments[0],m="string"==typeof f,p=[].slice.call(arguments,1);return a.each(function(){var t,g,h,v=e(this),b=v.find(s.selector.sides),y=v.find(s.selector.side),x="transitionend msTransitionEnd oTransitionEnd webkitTransitionEnd",w=this,C=v.data(c),k=(s.namespace,s.error),T=s.className;h={initialize:function(){h.verbose("Initializing module for",w),h.set.defaultSide(),C=h,v.data(c,C)},destroy:function(){h.verbose("Destroying previous module for",w),v.removeData(c).off(r)},refresh:function(){h.verbose("Refreshing selector cache for",w),v=e(w),b=e(this).find(s.selector.shape),y=e(this).find(s.selector.side)},repaint:function(){h.verbose("Forcing repaint event");var e=b.get(0)||n.createElement("div");e.offsetWidth},animate:function(n,o){h.verbose("Animating box with properties",n),o=o||function(t){h.reset(),h.set.active(),e.proxy(s.onChange,g)(),t.stopImmediatePropagation()},s.useCSS?(h.verbose("Starting CSS animation"),v.addClass(T.animating),h.set.stageSize(),h.repaint(),v.addClass(T.css),t.addClass(T.hidden),b.css(n).one(x,o)):(h.verbose("Starting javascript animation"),v.addClass(T.animating).removeClass(T.css),h.set.stageSize(),h.repaint(),t.animate({opacity:0},s.duration,s.easing),b.animate(n,s.duration,s.easing,o))},queue:function(e){h.debug("Queueing animation of",e),b.one(x,function(){h.debug("Executing queued animation"),v.shape(e)})},reset:function(){h.verbose("Animating states reset"),v.removeClass(T.css).removeClass(T.animating).removeAttr("style"),b.removeAttr("style"),y.removeAttr("style").removeClass(T.hidden),g.removeClass(T.animating).removeAttr("style")},is:{animating:function(){return v.hasClass(T.animating)}},get:{nextSide:function(){return t.next(s.selector.side).size()>0?t.next(s.selector.side):v.find(s.selector.side).first()}},set:{defaultSide:function(){t=v.find("."+s.className.active),g=t.next(s.selector.side).size()>0?t.next(s.selector.side):v.find(s.selector.side).first(),h.verbose("Active side set to",t),h.verbose("Next side set to",g)},stageSize:function(){var e={width:g.outerWidth(),height:g.outerHeight()};h.verbose("Resizing stage to fit new content",e),v.css({width:e.width,height:e.height})},nextSide:function(e){g=v.find(e),0===g.size()&&h.error(k.side),h.verbose("Next side manually set to",g)},active:function(){h.verbose("Setting new side to active",g),y.removeClass(T.active),g.addClass(T.active),h.set.defaultSide()}},flip:{up:function(){h.debug("Flipping up",g),h.is.animating()?h.queue("flip.up"):(h.stage.above(),h.animate(h.getTransform.up()))},down:function(){h.debug("Flipping down",g),h.is.animating()?h.queue("flip.down"):(h.stage.below(),h.animate(h.getTransform.down()))},left:function(){h.debug("Flipping left",g),h.is.animating()?h.queue("flip.left"):(h.stage.left(),h.animate(h.getTransform.left()))},right:function(){h.debug("Flipping right",g),h.is.animating()?h.queue("flip.right"):(h.stage.right(),h.animate(h.getTransform.right()))},over:function(){h.debug("Flipping over",g),h.is.animating()?h.queue("flip.over"):(h.stage.behind(),h.animate(h.getTransform.behind()))}},getTransform:{up:function(){var e={y:-((t.outerHeight()-g.outerHeight())/2),z:-(t.outerHeight()/2)};return{transform:"translateY("+e.y+"px) translateZ("+e.z+"px) rotateX(-90deg)"}},down:function(){var e={y:-((t.outerHeight()-g.outerHeight())/2),z:-(t.outerHeight()/2)};return{transform:"translateY("+e.y+"px) translateZ("+e.z+"px) rotateX(90deg)"}},left:function(){var e={x:-((t.outerWidth()-g.outerWidth())/2),z:-(t.outerWidth()/2)};return{transform:"translateX("+e.x+"px) translateZ("+e.z+"px) rotateY(90deg)"}},right:function(){var e={x:-((t.outerWidth()-g.outerWidth())/2),z:-(t.outerWidth()/2)};return{transform:"translateX("+e.x+"px) translateZ("+e.z+"px) rotateY(-90deg)"}},behind:function(){var e={x:-((t.outerWidth()-g.outerWidth())/2)};return{transform:"translateX("+e.x+"px) rotateY(180deg)"}}},stage:{above:function(){var e={origin:(t.outerHeight()-g.outerHeight())/2,depth:{active:g.outerHeight()/2,next:t.outerHeight()/2}};h.verbose("Setting the initial animation position as above",g,e),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),g.addClass(T.animating).css({display:"block",top:e.origin+"px",transform:"rotateX(90deg) translateZ("+e.depth.next+"px)"})},below:function(){var e={origin:(t.outerHeight()-g.outerHeight())/2,depth:{active:g.outerHeight()/2,next:t.outerHeight()/2}};h.verbose("Setting the initial animation position as below",g,e),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),g.addClass(T.animating).css({display:"block",top:e.origin+"px",transform:"rotateX(-90deg) translateZ("+e.depth.next+"px)"})},left:function(){var e={origin:(t.outerWidth()-g.outerWidth())/2,depth:{active:g.outerWidth()/2,next:t.outerWidth()/2}};h.verbose("Setting the initial animation position as left",g,e),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),g.addClass(T.animating).css({display:"block",left:e.origin+"px",transform:"rotateY(-90deg) translateZ("+e.depth.next+"px)"})},right:function(){var e={origin:(t.outerWidth()-g.outerWidth())/2,depth:{active:g.outerWidth()/2,next:t.outerWidth()/2}};h.verbose("Setting the initial animation position as left",g,e),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),g.addClass(T.animating).css({display:"block",left:e.origin+"px",transform:"rotateY(90deg) translateZ("+e.depth.next+"px)"})},behind:function(){var e={origin:(t.outerWidth()-g.outerWidth())/2,depth:{active:g.outerWidth()/2,next:t.outerWidth()/2}};h.verbose("Setting the initial animation position as behind",g,e),t.css({transform:"rotateY(0deg)"}),g.addClass(T.animating).css({display:"block",left:e.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(t,n){return n===o?s[t]:(e.isPlainObject(t)?(h.verbose("Modifying settings object",t,n),e.extend(!0,s,t)):(h.verbose("Modifying setting",t,n),s[t]=n),o)},internal:function(t,n){return n===o?h[t]:(e.isPlainObject(t)?(h.verbose("Modifying internal property",t,n),e.extend(!0,h,t)):(h.verbose("Changing internal method to",n),h[t]=n),o)},debug:function(){s.debug&&(s.performance?h.performance.log(arguments):h.debug=Function.prototype.bind.call(console.info,console,s.moduleName+":"))},verbose:function(){s.verbose&&s.debug&&(s.performance?h.performance.log(arguments):h.verbose=Function.prototype.bind.call(console.info,console,s.moduleName+":"))},error:function(){h.error=Function.prototype.bind.call(console.log,console,s.moduleName+":")},performance:{log:function(e){var t,n,o;s.performance&&(t=(new Date).getTime(),o=u||t,n=t-o,u=t,d.push({Element:w,Name:e[0],Arguments:e[1]||"None","Execution Time":n}),clearTimeout(h.performance.timer),h.performance.timer=setTimeout(h.performance.display,100))},display:function(){var t=s.moduleName,n=(s.moduleName+": "+l+"("+a.size()+" elements)",0);l&&(t+=" Performance ("+l+")"),(console.group!==o||console.table!==o)&&d.length>0&&(console.groupCollapsed(t),console.table?(e.each(d,function(e,t){n+=t["Execution Time"]}),console.table(d)):e.each(d,function(e,t){n+=t["Execution Time"],console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.log("Total Execution Time:",n+"ms"),console.groupEnd(),d=[],u=!1)}},invoke:function(t,n,i){var a,s;return n=n||p,i=w||i,"string"==typeof t&&C!==o&&(t=t.split("."),a=t.length-1,e.each(t,function(t,n){return e.isPlainObject(C[n])&&t!=a?(C=C[n],!0):C[n]!==o?(s=C[n],!0):(h.error(errors.method),!1)})),e.isFunction(s)?(h.verbose("Executing invoked function",s),s.apply(i,n)):s||!1}},m?(C===o&&h.initialize(),i=h.invoke(f)):(C!==o&&h.destroy(),h.initialize())}),i?i:this},e.fn.shape.settings={moduleName:"Shape Module",debug:!0,verbose:!0,performance:!0,namespace:"shape",beforeChange:function(){},onChange:function(){},useCSS:!0,duration:1e3,easing:"easeInOutQuad",error:{side:"You tried to switch to a side that does not exist.",method:"The method you called is not defined"},className:{css:"css",animating:"animating",hidden:"hidden",active:"active"},selector:{sides:".sides",side:".side"}}})(jQuery,window,document); \ No newline at end of file diff --git a/build/minified/modules/tab.min.js b/build/minified/modules/tab.min.js index 14142d415..80c94dcb6 100644 --- a/build/minified/modules/tab.min.js +++ b/build/minified/modules/tab.min.js @@ -1 +1 @@ -(function(e,t,n,o){e.fn.tabNavigation=function(n){var i,a,s,r,l,c=e.extend(!0,{},e.fn.tabNavigation.settings,n),u=e(this),d=e(c.context).find(c.selector.tabs),f=!0,m={},p=0,g=c.className,h=c.metadata,v=c.namespace,b=c.errors,y=u.data("module"),x=arguments[0],w=y!==o&&"string"==typeof x,C=[].slice.call(arguments,1);return r={initialize:function(){r.debug("Initializing Tabs",u),c.history&&c.path!==!1&&(e.address!==o?(r.verbose("Address library found adding state change event"),e.address.state(c.path).change(r.event.history.change)):r.error(b.state)),e.isWindow(u.get(0))||u.on("click."+v,r.event.click),u.data("module",r)},destroy:function(){r.debug("Destroying tabs",u),u.off("."+v)},event:{click:function(){r.debug("Navigation clicked");var t=e(this).data(h.tab);t!==o?t!==i&&(c.history?e.address.value(t):r.change(t)):r.debug("No tab specified")},history:{change:function(t){var n=t.pathNames.join("/")||r.get.initialPath(),i=c.templates.determineTitle(n)||!1;r.debug("History change event",n,t),s=t,n!==o&&r.change(n),i&&e.address.title(i)}}},refresh:function(){i&&(r.debug("Refreshing tab",i),r.change(i))},cache:{read:function(e){return e!==o?m[e]:m},add:function(e,t){e=e||i,r.debug("Adding cached content for",e),m[e]=t},remove:function(e){e=e||i,r.debug("Removing cached content for",e),delete m[e]}},change:function(n){var l=r.get.defaultPathArray(n);r.deactivate.all(),e.each(l,function(u,d){var p=l.slice(0,u+1),g=r.utils.arrayToPath(p),h=r.utils.last(l)==g,v=r.is.tab(g),b=!v,y=t.history&&t.history.pushState,x=y&&c.ignoreFirstLoad&&f,w=e.isPlainObject(c.apiSettings),C=r.get.tabElement(g);return r.verbose("Looking for tab",d),b?(r.verbose("Tab is not found, assuming it is a parameter",d),!0):(v&&(r.verbose("Tab was found",d),i=g,a=r.utils.filterArray(l,p),h&&w?x?(r.debug("Ignoring remote content on first tab load",g),f=!1,m[n]=C.html(),r.activate.all(g),e.proxy(c.onTabInit,C)(g,a,s)):(r.activate.navigation(g),r.content.fetch(g,c.onTabLoad)):(r.debug("Opened tab",g),r.activate.all(g),e.proxy(c.onTabLoad,C)(g,a,s))),o)})},content:{fetch:function(t){var n=r.get.tabElement(t),l=m[t]||!1,u={dataType:"html",stateContext:n,success:function(o){m[t]=o,r.content.update(t,o),t==i?(r.debug("Content loaded",t),r.activate.tab(t)):r.debug("Content loaded in background",t),e.proxy(c.onTabInit,n)(t,a,s)},urlData:{tab:t}},d=n.data(h.promise)||!1,f=d&&"pending"===d.state();c.cache&&l?(r.debug("Showing existing content",t),r.activate.tab(t),e.proxy(c.onTabLoad,n)(t,a,s)):f?(r.debug("Content is already loading",t),n.addClass(g.loading)):e.api!==o?(r.debug("Retrieving content",t),e.api(e.extend(!0,{},c.apiSettings,u))):r.error(b.api)},update:function(e,t){r.debug("Updating html for",e);var n=r.get.tabElement(e);n.html(t)}},activate:{all:function(e){r.activate.tab(e),r.activate.navigation(e)},tab:function(e){var t=r.get.tabElement(e);r.verbose("Showing tab content for",t),t.addClass(g.active)},navigation:function(e){var t=r.get.navElement(e);r.verbose("Activating tab navigation for",t),t.addClass(g.active)}},deactivate:{all:function(){r.deactivate.navigation(),r.deactivate.tabs()},navigation:function(){u.removeClass(g.active)},tabs:function(){d.removeClass(g.active+" "+g.loading)}},is:{tab:function(e){return r.get.tabElement(e).size()>0}},get:{initialPath:function(){return u.eq(0).data(h.tab)||d.eq(0).data(h.tab)},defaultPathArray:function(e){return r.utils.pathToArray(r.get.defaultPath(e))},defaultPath:function(e){var t=u.filter("[data-"+h.tab+'^="'+e+'/"]').eq(0),n=t.data(h.tab)||!1;if(n){if(r.debug("Found default tab",n),c.maxDepth>p)return p++,r.get.defaultPath(n);r.error(b.recursion)}return p=0,e},navElement:function(e){return e=e||i,u.filter("[data-"+h.tab+'="'+e+'"]')},tabElement:function(e){var t,n,o,a;return e=e||i,o=r.utils.pathToArray(e),a=r.utils.last(o),t=d.filter("[data-"+h.tab+'="'+a+'"]'),n=d.filter("[data-"+h.tab+'="'+e+'"]'),t.size()>0?t:n},tab:function(){return i}},utils:{filterArray:function(t,n){return e.grep(t,function(t){return-1==e.inArray(t,n)})},last:function(t){return e.isArray(t)?t[t.length-1]:!1},pathToArray:function(e){return e===o&&(e=i),"string"==typeof e?e.split("/"):[e]},arrayToPath:function(t){return e.isArray(t)?t.join("/"):!1}},setting:function(e,t){return t===o?c[e]:(c[e]=t,o)},verbose:function(){c.verbose&&r.debug.apply(this,arguments)},debug:function(){var e=[],t=c.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.info||console.log||function(){};o=Function.prototype.bind.call(o,console),c.debug&&(e.push(t),o.apply(console,e.concat(n)))},error:function(){var e=[],t=c.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.warn||console.log||function(){};o=Function.prototype.bind.call(o,console),c.debug&&(e.push(t),e.concat(n),o.apply(console,e.concat(n)))},invoke:function(t,n,i){var a,s;return i=i||[].slice.call(arguments,2),"string"==typeof t&&y!==o&&(t=t.split("."),a=t.length-1,e.each(t,function(t,n){return e.isPlainObject(y[n])&&t!=a?(y=y[n],!0):y[n]!==o?(s=y[n],!0):(r.error(c.errors.method),!1)})),e.isFunction(s)?s.apply(n,i):s}},w?l=r.invoke(x,this,C):r.initialize(),l!==o?l:this},e.tabNavigation=function(n){e(t).tabNavigation(n)},e.fn.tabNavigation.settings={moduleName:"Tab Module",verbose:!1,debug:!0,namespace:"tab",onTabInit:function(){},onTabLoad:function(){},templates:{determineTitle:function(){}},history:!1,path:!1,context:"body",maxDepth:25,ignoreFirstLoad:!0,alwaysRefresh:!1,cache:!0,apiSettings:!1,errors:{api:"You attempted to load content without API module",noContent:"The tab you specified is missing a content url.",method:"The method you called is not defined",state:"The state library has not been initialized",missingTab:"Missing tab: ",recursion:"Max recursive depth reached"},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".tab"}}})(jQuery,window,document); \ No newline at end of file +(function(e,t,n,o){e.fn.tabNavigation=function(n){var i,a,r,s,c,l=e.extend(!0,{},e.fn.tabNavigation.settings,n),u=e(this),d=e(l.context).find(l.selector.tabs),f=!0,m={},p=0,g=l.className,h=l.metadata,v=l.namespace,b=l.errors,y=u.data("module"),x=arguments[0],w=y!==o&&"string"==typeof x,C=[].slice.call(arguments,1);return s={initialize:function(){s.debug("Initializing Tabs",u),l.history&&l.path!==!1&&(e.address!==o?(s.verbose("Address library found adding state change event"),e.address.state(l.path).change(s.event.history.change)):s.error(b.state)),e.isWindow(u.get(0))||u.on("click."+v,s.event.click),u.data("module",s)},destroy:function(){s.debug("Destroying tabs",u),u.off("."+v)},event:{click:function(){s.debug("Navigation clicked");var t=e(this).data(h.tab);t!==o?t!==i&&(l.history?e.address.value(t):s.change(t)):s.debug("No tab specified")},history:{change:function(t){var n=t.pathNames.join("/")||s.get.initialPath(),i=l.templates.determineTitle(n)||!1;s.debug("History change event",n,t),r=t,n!==o&&s.change(n),i&&e.address.title(i)}}},refresh:function(){i&&(s.debug("Refreshing tab",i),s.change(i))},cache:{read:function(e){return e!==o?m[e]:m},add:function(e,t){e=e||i,s.debug("Adding cached content for",e),m[e]=t},remove:function(e){e=e||i,s.debug("Removing cached content for",e),delete m[e]}},change:function(n){var c=s.get.defaultPathArray(n);s.deactivate.all(),e.each(c,function(u,d){var p=c.slice(0,u+1),g=s.utils.arrayToPath(p),h=s.utils.last(c)==g,v=s.is.tab(g),b=!v,y=t.history&&t.history.pushState,x=y&&l.ignoreFirstLoad&&f,w=e.isPlainObject(l.apiSettings),C=s.get.tabElement(g);return s.verbose("Looking for tab",d),b?(s.verbose("Tab is not found, assuming it is a parameter",d),!0):(v&&(s.verbose("Tab was found",d),i=g,a=s.utils.filterArray(c,p),h&&w?x?(s.debug("Ignoring remote content on first tab load",g),f=!1,m[n]=C.html(),s.activate.all(g),e.proxy(l.onTabInit,C)(g,a,r)):(s.activate.navigation(g),s.content.fetch(g,l.onTabLoad)):(s.debug("Opened tab",g),s.activate.all(g),e.proxy(l.onTabLoad,C)(g,a,r))),o)})},content:{fetch:function(t){var n=s.get.tabElement(t),c=m[t]||!1,u={dataType:"html",stateContext:n,success:function(o){m[t]=o,s.content.update(t,o),t==i?(s.debug("Content loaded",t),s.activate.tab(t)):s.debug("Content loaded in background",t),e.proxy(l.onTabInit,n)(t,a,r)},urlData:{tab:t}},d=n.data(h.promise)||!1,f=d&&"pending"===d.state();l.cache&&c?(s.debug("Showing existing content",t),s.activate.tab(t),e.proxy(l.onTabLoad,n)(t,a,r)):f?(s.debug("Content is already loading",t),n.addClass(g.loading)):e.api!==o?(s.debug("Retrieving content",t),e.api(e.extend(!0,{},l.apiSettings,u))):s.error(b.api)},update:function(e,t){s.debug("Updating html for",e);var n=s.get.tabElement(e);n.html(t)}},activate:{all:function(e){s.activate.tab(e),s.activate.navigation(e)},tab:function(e){var t=s.get.tabElement(e);s.verbose("Showing tab content for",t),t.addClass(g.active)},navigation:function(e){var t=s.get.navElement(e);s.verbose("Activating tab navigation for",t),t.addClass(g.active)}},deactivate:{all:function(){s.deactivate.navigation(),s.deactivate.tabs()},navigation:function(){u.removeClass(g.active)},tabs:function(){d.removeClass(g.active+" "+g.loading)}},is:{tab:function(e){return s.get.tabElement(e).size()>0}},get:{initialPath:function(){return u.eq(0).data(h.tab)||d.eq(0).data(h.tab)},defaultPathArray:function(e){return s.utils.pathToArray(s.get.defaultPath(e))},defaultPath:function(e){var t=u.filter("[data-"+h.tab+'^="'+e+'/"]').eq(0),n=t.data(h.tab)||!1;if(n){if(s.debug("Found default tab",n),l.maxDepth>p)return p++,s.get.defaultPath(n);s.error(b.recursion)}return p=0,e},navElement:function(e){return e=e||i,u.filter("[data-"+h.tab+'="'+e+'"]')},tabElement:function(e){var t,n,o,a;return e=e||i,o=s.utils.pathToArray(e),a=s.utils.last(o),t=d.filter("[data-"+h.tab+'="'+a+'"]'),n=d.filter("[data-"+h.tab+'="'+e+'"]'),t.size()>0?t:n},tab:function(){return i}},utils:{filterArray:function(t,n){return e.grep(t,function(t){return-1==e.inArray(t,n)})},last:function(t){return e.isArray(t)?t[t.length-1]:!1},pathToArray:function(e){return e===o&&(e=i),"string"==typeof e?e.split("/"):[e]},arrayToPath:function(t){return e.isArray(t)?t.join("/"):!1}},setting:function(e,t){return t===o?l[e]:(l[e]=t,o)},verbose:function(){l.verbose&&s.debug.apply(this,arguments)},debug:function(){var e=[],t=l.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.info||console.log||function(){};o=Function.prototype.bind.call(o,console),l.debug&&(e.push(t),o.apply(console,e.concat(n)))},error:function(){var e=[],t=l.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.warn||console.log||function(){};o=Function.prototype.bind.call(o,console),l.debug&&(e.push(t),e.concat(n),o.apply(console,e.concat(n)))},invoke:function(t,n,i){var a,r;return i=i||[].slice.call(arguments,2),"string"==typeof t&&y!==o&&(t=t.split("."),a=t.length-1,e.each(t,function(t,n){return e.isPlainObject(y[n])&&t!=a?(y=y[n],!0):y[n]!==o?(r=y[n],!0):(s.error(l.errors.method),!1)})),e.isFunction(r)?r.apply(n,i):r}},w?c=s.invoke(x,this,C):s.initialize(),c!==o?c:this},e.tabNavigation=function(n){e(t).tabNavigation(n)},e.fn.tabNavigation.settings={moduleName:"Tab Module",verbose:!1,debug:!0,namespace:"tab",onTabInit:function(){},onTabLoad:function(){},templates:{determineTitle:function(){}},history:!1,path:!1,context:"body",maxDepth:25,ignoreFirstLoad:!0,alwaysRefresh:!1,cache:!0,apiSettings:!1,errors:{api:"You attempted to load content without API module",noContent:"The tab you specified is missing a content url.",method:"The method you called is not defined",state:"The state library has not been initialized",missingTab:"Missing tab: ",recursion:"Max recursive depth reached"},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".tab"}}})(jQuery,window,document); \ No newline at end of file diff --git a/build/packaged/modules/carousel.js b/build/packaged/modules/carousel.js new file mode 100644 index 000000000..e95867e0f --- /dev/null +++ b/build/packaged/modules/carousel.js @@ -0,0 +1,325 @@ +/* ****************************** + Semantic Module: Carousel + Author: Jack Lukic + Notes: First Commit May 28, 2013 + + A carousel alternates between + several pieces of content in sequence. + +****************************** */ + +;(function ( $, window, document, undefined ) { + +$.fn.carousel = function(parameters) { + var + $allModules = $(this), + + settings = $.extend(true, {}, $.fn.carousel.settings, parameters), + + eventNamespace = '.' + settings.namespace, + moduleNamespace = 'module-' + settings.namespace, + moduleSelector = $allModules.selector || '', + + time = new Date().getTime(), + performance = [], + + query = arguments[0], + methodInvoked = (typeof query == 'string'), + queryArguments = [].slice.call(arguments, 1), + invokedResponse + ; + + $allModules + .each(function() { + var + $module = $(this), + $arrows = $(settings.selector.arrows), + $leftArrow = $(settings.selector.leftArrow), + $rightArrow = $(settings.selector.rightArrow), + $content = $(settings.selector.content), + $navigation = $(settings.selector.navigation), + $navItem = $(settings.selector.navItem), + + selector = $module.selector || '', + element = this, + instance = $module.data('module-' + settings.namespace), + + className = settings.className, + namespace = settings.namespace, + errors = settings.errors, + module + ; + + module = { + + initialize: function() { + module.openingAnimation(); + module.marquee.autoAdvance(); + $leftArrow + .on('click', module.marquee.left) + ; + $rightArrow + .on('click', module.marquee.right) + ; + $navItem + .on('click', module.marquee.change) + ; + }, + + destroy: function() { + module.verbose('Destroying previous module for', $module); + $module + .off(namespace) + ; + }, + + left: function() { + var + $activeContent = $content.filter('.' + className.active), + currentIndex = $content.index($activeContent), + imageCount = $content.size(), + newIndex = (currentIndex - 1 != -1) + ? (currentIndex - 1) + : (imageCount - 1) + ; + $navItem + .eq(newIndex) + .trigger('click') + ; + }, + + right: function() { + var + $activeContent = $content.filter('.' + className.active), + currentIndex = $content.index($activeContent), + imageCount = $content.size(), + newIndex = (currentIndex + 1 != imageCount) + ? (currentIndex + 1) + : 0 + ; + $navItem + .eq(newIndex) + .trigger('click') + ; + }, + + change: function() { + var + $selected = $(this), + selectedIndex = $navItem.index($selected), + $selectedImage = $content.eq(selectedIndex) + ; + module.marquee.autoAdvance(); + $selected + .addClass('active') + .siblings() + .removeClass('active') + ; + $selectedImage + .addClass('active animated fadeIn') + .siblings('.' + className.active) + .removeClass('animated fadeIn scaleIn') + .animate({ + opacity: 0 + }, 500, function(){ + $(this) + .removeClass('active') + .removeAttr('style') + ; + }) + ; + }, + + autoAdvance: function() { + clearInterval(module.timer); + module.timer = setInterval(module.marquee.right, settings.duration); + }, + + setting: function(name, value) { + if(value !== undefined) { + if( $.isPlainObject(name) ) { + module.verbose('Modifying settings object', name, value); + $.extend(true, settings, name); + } + else { + module.verbose('Modifying setting', name, value); + settings[name] = value; + } + } + else { + return settings[name]; + } + }, + internal: function(name, value) { + if(value !== undefined) { + if( $.isPlainObject(name) ) { + module.verbose('Modifying internal property', name, value); + $.extend(true, module, name); + } + else { + module.verbose('Changing internal method to', value); + module[name] = value; + } + } + else { + return module[name]; + } + }, + debug: function() { + if(settings.debug) { + if(settings.performance) { + module.performance.log(arguments); + } + else { + module.debug = Function.prototype.bind.call(console.info, console, settings.moduleName + ':'); + } + } + }, + verbose: function() { + if(settings.verbose && settings.debug) { + if(settings.performance) { + module.performance.log(arguments); + } + else { + module.verbose = Function.prototype.bind.call(console.info, console, settings.moduleName + ':'); + } + } + }, + error: function() { + module.error = Function.prototype.bind.call(console.log, console, settings.moduleName + ':'); + }, + performance: { + log: function(message) { + var + currentTime, + executionTime, + previousTime + ; + if(settings.performance) { + currentTime = new Date().getTime(); + previousTime = time || currentTime, + executionTime = currentTime - previousTime; + time = currentTime; + performance.push({ + 'Element' : element, + 'Name' : message[0], + 'Arguments' : message[1] || 'None', + 'Execution Time' : executionTime + }); + clearTimeout(module.performance.timer); + module.performance.timer = setTimeout(module.performance.display, 100); + } + }, + display: function() { + var + title = settings.moduleName, + caption = settings.moduleName + ': ' + moduleSelector + '(' + $allModules.size() + ' elements)', + totalExecutionTime = 0 + ; + if(moduleSelector) { + title += ' Performance (' + moduleSelector + ')'; + } + if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) { + console.groupCollapsed(title); + if(console.table) { + $.each(performance, function(index, data) { + totalExecutionTime += data['Execution Time']; + }); + console.table(performance); + } + else { + $.each(performance, function(index, data) { + totalExecutionTime += data['Execution Time']; + console.log(data['Name'] + ': ' + data['Execution Time']+'ms'); + }); + } + console.log('Total Execution Time:', totalExecutionTime +'ms'); + console.groupEnd(); + performance = []; + time = false; + } + } + }, + invoke: function(query, passedArguments, context) { + var + maxDepth, + found + ; + passedArguments = passedArguments || queryArguments; + context = element || context; + if(typeof query == 'string' && instance !== undefined) { + query = query.split('.'); + maxDepth = query.length - 1; + $.each(query, function(depth, value) { + if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { + instance = instance[value]; + return true; + } + else if( instance[value] !== undefined ) { + found = instance[value]; + return true; + } + module.error(errors.method); + return false; + }); + } + if ( $.isFunction( found ) ) { + module.verbose('Executing invoked function', found); + return found.apply(context, passedArguments); + } + return found || false; + } + }; + + if(methodInvoked) { + if(instance === undefined) { + module.initialize(); + } + invokedResponse = module.invoke(query); + } + else { + if(instance !== undefined) { + module.destroy(); + } + module.initialize(); + } + }) + ; + return (invokedResponse) + ? invokedResponse + : this + ; +}; + +$.fn.carousel.settings = { + + moduleName : 'Carousel Module', + namespace : 'carousel', + + verbose : true, + debug : true, + performance : true, + + // delegated event context + duration: 5000, + + errors : { + method : 'The method you called is not defined.' + }, + + selector : { + arrows : '.arrow', + leftArrow : '.left.arrow', + rightArrow : '.right.arrow', + content : '.content', + navigation : '.navigation', + navItem : '.navigation .icon' + }, + + className : { + active : 'active' + } + +}; + +})( jQuery, window , document ); diff --git a/build/packaged/semantic.min.js.REMOVED.git-id b/build/packaged/semantic.min.js.REMOVED.git-id index 7bce8aff8..0f01ffe33 100644 --- a/build/packaged/semantic.min.js.REMOVED.git-id +++ b/build/packaged/semantic.min.js.REMOVED.git-id @@ -1 +1 @@ -ae0c02f4bdcd565bf4bb21fc98ab167e9fffc02e \ No newline at end of file +1a4ff22da9c3b4e30339c89eeb83925c00dcf89a \ No newline at end of file diff --git a/build/uncompressed/modules/carousel.js b/build/uncompressed/modules/carousel.js new file mode 100644 index 000000000..e95867e0f --- /dev/null +++ b/build/uncompressed/modules/carousel.js @@ -0,0 +1,325 @@ +/* ****************************** + Semantic Module: Carousel + Author: Jack Lukic + Notes: First Commit May 28, 2013 + + A carousel alternates between + several pieces of content in sequence. + +****************************** */ + +;(function ( $, window, document, undefined ) { + +$.fn.carousel = function(parameters) { + var + $allModules = $(this), + + settings = $.extend(true, {}, $.fn.carousel.settings, parameters), + + eventNamespace = '.' + settings.namespace, + moduleNamespace = 'module-' + settings.namespace, + moduleSelector = $allModules.selector || '', + + time = new Date().getTime(), + performance = [], + + query = arguments[0], + methodInvoked = (typeof query == 'string'), + queryArguments = [].slice.call(arguments, 1), + invokedResponse + ; + + $allModules + .each(function() { + var + $module = $(this), + $arrows = $(settings.selector.arrows), + $leftArrow = $(settings.selector.leftArrow), + $rightArrow = $(settings.selector.rightArrow), + $content = $(settings.selector.content), + $navigation = $(settings.selector.navigation), + $navItem = $(settings.selector.navItem), + + selector = $module.selector || '', + element = this, + instance = $module.data('module-' + settings.namespace), + + className = settings.className, + namespace = settings.namespace, + errors = settings.errors, + module + ; + + module = { + + initialize: function() { + module.openingAnimation(); + module.marquee.autoAdvance(); + $leftArrow + .on('click', module.marquee.left) + ; + $rightArrow + .on('click', module.marquee.right) + ; + $navItem + .on('click', module.marquee.change) + ; + }, + + destroy: function() { + module.verbose('Destroying previous module for', $module); + $module + .off(namespace) + ; + }, + + left: function() { + var + $activeContent = $content.filter('.' + className.active), + currentIndex = $content.index($activeContent), + imageCount = $content.size(), + newIndex = (currentIndex - 1 != -1) + ? (currentIndex - 1) + : (imageCount - 1) + ; + $navItem + .eq(newIndex) + .trigger('click') + ; + }, + + right: function() { + var + $activeContent = $content.filter('.' + className.active), + currentIndex = $content.index($activeContent), + imageCount = $content.size(), + newIndex = (currentIndex + 1 != imageCount) + ? (currentIndex + 1) + : 0 + ; + $navItem + .eq(newIndex) + .trigger('click') + ; + }, + + change: function() { + var + $selected = $(this), + selectedIndex = $navItem.index($selected), + $selectedImage = $content.eq(selectedIndex) + ; + module.marquee.autoAdvance(); + $selected + .addClass('active') + .siblings() + .removeClass('active') + ; + $selectedImage + .addClass('active animated fadeIn') + .siblings('.' + className.active) + .removeClass('animated fadeIn scaleIn') + .animate({ + opacity: 0 + }, 500, function(){ + $(this) + .removeClass('active') + .removeAttr('style') + ; + }) + ; + }, + + autoAdvance: function() { + clearInterval(module.timer); + module.timer = setInterval(module.marquee.right, settings.duration); + }, + + setting: function(name, value) { + if(value !== undefined) { + if( $.isPlainObject(name) ) { + module.verbose('Modifying settings object', name, value); + $.extend(true, settings, name); + } + else { + module.verbose('Modifying setting', name, value); + settings[name] = value; + } + } + else { + return settings[name]; + } + }, + internal: function(name, value) { + if(value !== undefined) { + if( $.isPlainObject(name) ) { + module.verbose('Modifying internal property', name, value); + $.extend(true, module, name); + } + else { + module.verbose('Changing internal method to', value); + module[name] = value; + } + } + else { + return module[name]; + } + }, + debug: function() { + if(settings.debug) { + if(settings.performance) { + module.performance.log(arguments); + } + else { + module.debug = Function.prototype.bind.call(console.info, console, settings.moduleName + ':'); + } + } + }, + verbose: function() { + if(settings.verbose && settings.debug) { + if(settings.performance) { + module.performance.log(arguments); + } + else { + module.verbose = Function.prototype.bind.call(console.info, console, settings.moduleName + ':'); + } + } + }, + error: function() { + module.error = Function.prototype.bind.call(console.log, console, settings.moduleName + ':'); + }, + performance: { + log: function(message) { + var + currentTime, + executionTime, + previousTime + ; + if(settings.performance) { + currentTime = new Date().getTime(); + previousTime = time || currentTime, + executionTime = currentTime - previousTime; + time = currentTime; + performance.push({ + 'Element' : element, + 'Name' : message[0], + 'Arguments' : message[1] || 'None', + 'Execution Time' : executionTime + }); + clearTimeout(module.performance.timer); + module.performance.timer = setTimeout(module.performance.display, 100); + } + }, + display: function() { + var + title = settings.moduleName, + caption = settings.moduleName + ': ' + moduleSelector + '(' + $allModules.size() + ' elements)', + totalExecutionTime = 0 + ; + if(moduleSelector) { + title += ' Performance (' + moduleSelector + ')'; + } + if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) { + console.groupCollapsed(title); + if(console.table) { + $.each(performance, function(index, data) { + totalExecutionTime += data['Execution Time']; + }); + console.table(performance); + } + else { + $.each(performance, function(index, data) { + totalExecutionTime += data['Execution Time']; + console.log(data['Name'] + ': ' + data['Execution Time']+'ms'); + }); + } + console.log('Total Execution Time:', totalExecutionTime +'ms'); + console.groupEnd(); + performance = []; + time = false; + } + } + }, + invoke: function(query, passedArguments, context) { + var + maxDepth, + found + ; + passedArguments = passedArguments || queryArguments; + context = element || context; + if(typeof query == 'string' && instance !== undefined) { + query = query.split('.'); + maxDepth = query.length - 1; + $.each(query, function(depth, value) { + if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { + instance = instance[value]; + return true; + } + else if( instance[value] !== undefined ) { + found = instance[value]; + return true; + } + module.error(errors.method); + return false; + }); + } + if ( $.isFunction( found ) ) { + module.verbose('Executing invoked function', found); + return found.apply(context, passedArguments); + } + return found || false; + } + }; + + if(methodInvoked) { + if(instance === undefined) { + module.initialize(); + } + invokedResponse = module.invoke(query); + } + else { + if(instance !== undefined) { + module.destroy(); + } + module.initialize(); + } + }) + ; + return (invokedResponse) + ? invokedResponse + : this + ; +}; + +$.fn.carousel.settings = { + + moduleName : 'Carousel Module', + namespace : 'carousel', + + verbose : true, + debug : true, + performance : true, + + // delegated event context + duration: 5000, + + errors : { + method : 'The method you called is not defined.' + }, + + selector : { + arrows : '.arrow', + leftArrow : '.left.arrow', + rightArrow : '.right.arrow', + content : '.content', + navigation : '.navigation', + navItem : '.navigation .icon' + }, + + className : { + active : 'active' + } + +}; + +})( jQuery, window , document ); diff --git a/node/src/documents/modules/carousel.html b/node/src/documents/modules/carousel.html new file mode 100755 index 000000000..9e0f56f72 --- /dev/null +++ b/node/src/documents/modules/carousel.html @@ -0,0 +1,161 @@ +--- +layout : 'default' +css : 'carousel' + +title : 'Carousel' +type : 'UI Module' +--- + + +
+
+

Carousel

+

A carousel is a ui module which indicates a user's selection of a choice.

+
+
+
+ + + +

Standard

+ +
+

Carousel

+

A standard carousel

+ + +
+ +

Usage

+ +

Initializing

+

Initializing a check box

+
+ $('.ui.carousel') + .carousel() + ; +
+ +

Settings

+ + + + + + + + + + + + + + + + +
Carousel Settings
requiredautoSetting to true/false will determine whether an input will allow no selection. Auto will set disallow this behavior only for radio boxes
contextfalseA selector or jQuery object to use as a delegated event context
+ + + + + + + + + + + + + + + + + + + + + + +
Callbacks
onChangeNoneCallback after a carousel is either disabled or enabled.
onEnableNoneCallback after a carousel is enabled.
onDisableNoneCallback after a carousel is disabled.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
UI Module Settings
moduleNameCarouselName used in debug logs
debugTrueProvides standard debug output to console
performanceFalseProvides standard debug output to console
verboseFalseProvides ancillary debug output to console
namespacecarouselEvent namespace. Makes sure module teardown does not effect other events attached to an element.
errors +
+ errors : { + method : 'The method you called is not defined.' + } +
+
+ +
+ + + \ No newline at end of file diff --git a/node/src/files/components/semantic/modules/carousel.js b/node/src/files/components/semantic/modules/carousel.js new file mode 100644 index 000000000..e95867e0f --- /dev/null +++ b/node/src/files/components/semantic/modules/carousel.js @@ -0,0 +1,325 @@ +/* ****************************** + Semantic Module: Carousel + Author: Jack Lukic + Notes: First Commit May 28, 2013 + + A carousel alternates between + several pieces of content in sequence. + +****************************** */ + +;(function ( $, window, document, undefined ) { + +$.fn.carousel = function(parameters) { + var + $allModules = $(this), + + settings = $.extend(true, {}, $.fn.carousel.settings, parameters), + + eventNamespace = '.' + settings.namespace, + moduleNamespace = 'module-' + settings.namespace, + moduleSelector = $allModules.selector || '', + + time = new Date().getTime(), + performance = [], + + query = arguments[0], + methodInvoked = (typeof query == 'string'), + queryArguments = [].slice.call(arguments, 1), + invokedResponse + ; + + $allModules + .each(function() { + var + $module = $(this), + $arrows = $(settings.selector.arrows), + $leftArrow = $(settings.selector.leftArrow), + $rightArrow = $(settings.selector.rightArrow), + $content = $(settings.selector.content), + $navigation = $(settings.selector.navigation), + $navItem = $(settings.selector.navItem), + + selector = $module.selector || '', + element = this, + instance = $module.data('module-' + settings.namespace), + + className = settings.className, + namespace = settings.namespace, + errors = settings.errors, + module + ; + + module = { + + initialize: function() { + module.openingAnimation(); + module.marquee.autoAdvance(); + $leftArrow + .on('click', module.marquee.left) + ; + $rightArrow + .on('click', module.marquee.right) + ; + $navItem + .on('click', module.marquee.change) + ; + }, + + destroy: function() { + module.verbose('Destroying previous module for', $module); + $module + .off(namespace) + ; + }, + + left: function() { + var + $activeContent = $content.filter('.' + className.active), + currentIndex = $content.index($activeContent), + imageCount = $content.size(), + newIndex = (currentIndex - 1 != -1) + ? (currentIndex - 1) + : (imageCount - 1) + ; + $navItem + .eq(newIndex) + .trigger('click') + ; + }, + + right: function() { + var + $activeContent = $content.filter('.' + className.active), + currentIndex = $content.index($activeContent), + imageCount = $content.size(), + newIndex = (currentIndex + 1 != imageCount) + ? (currentIndex + 1) + : 0 + ; + $navItem + .eq(newIndex) + .trigger('click') + ; + }, + + change: function() { + var + $selected = $(this), + selectedIndex = $navItem.index($selected), + $selectedImage = $content.eq(selectedIndex) + ; + module.marquee.autoAdvance(); + $selected + .addClass('active') + .siblings() + .removeClass('active') + ; + $selectedImage + .addClass('active animated fadeIn') + .siblings('.' + className.active) + .removeClass('animated fadeIn scaleIn') + .animate({ + opacity: 0 + }, 500, function(){ + $(this) + .removeClass('active') + .removeAttr('style') + ; + }) + ; + }, + + autoAdvance: function() { + clearInterval(module.timer); + module.timer = setInterval(module.marquee.right, settings.duration); + }, + + setting: function(name, value) { + if(value !== undefined) { + if( $.isPlainObject(name) ) { + module.verbose('Modifying settings object', name, value); + $.extend(true, settings, name); + } + else { + module.verbose('Modifying setting', name, value); + settings[name] = value; + } + } + else { + return settings[name]; + } + }, + internal: function(name, value) { + if(value !== undefined) { + if( $.isPlainObject(name) ) { + module.verbose('Modifying internal property', name, value); + $.extend(true, module, name); + } + else { + module.verbose('Changing internal method to', value); + module[name] = value; + } + } + else { + return module[name]; + } + }, + debug: function() { + if(settings.debug) { + if(settings.performance) { + module.performance.log(arguments); + } + else { + module.debug = Function.prototype.bind.call(console.info, console, settings.moduleName + ':'); + } + } + }, + verbose: function() { + if(settings.verbose && settings.debug) { + if(settings.performance) { + module.performance.log(arguments); + } + else { + module.verbose = Function.prototype.bind.call(console.info, console, settings.moduleName + ':'); + } + } + }, + error: function() { + module.error = Function.prototype.bind.call(console.log, console, settings.moduleName + ':'); + }, + performance: { + log: function(message) { + var + currentTime, + executionTime, + previousTime + ; + if(settings.performance) { + currentTime = new Date().getTime(); + previousTime = time || currentTime, + executionTime = currentTime - previousTime; + time = currentTime; + performance.push({ + 'Element' : element, + 'Name' : message[0], + 'Arguments' : message[1] || 'None', + 'Execution Time' : executionTime + }); + clearTimeout(module.performance.timer); + module.performance.timer = setTimeout(module.performance.display, 100); + } + }, + display: function() { + var + title = settings.moduleName, + caption = settings.moduleName + ': ' + moduleSelector + '(' + $allModules.size() + ' elements)', + totalExecutionTime = 0 + ; + if(moduleSelector) { + title += ' Performance (' + moduleSelector + ')'; + } + if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) { + console.groupCollapsed(title); + if(console.table) { + $.each(performance, function(index, data) { + totalExecutionTime += data['Execution Time']; + }); + console.table(performance); + } + else { + $.each(performance, function(index, data) { + totalExecutionTime += data['Execution Time']; + console.log(data['Name'] + ': ' + data['Execution Time']+'ms'); + }); + } + console.log('Total Execution Time:', totalExecutionTime +'ms'); + console.groupEnd(); + performance = []; + time = false; + } + } + }, + invoke: function(query, passedArguments, context) { + var + maxDepth, + found + ; + passedArguments = passedArguments || queryArguments; + context = element || context; + if(typeof query == 'string' && instance !== undefined) { + query = query.split('.'); + maxDepth = query.length - 1; + $.each(query, function(depth, value) { + if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { + instance = instance[value]; + return true; + } + else if( instance[value] !== undefined ) { + found = instance[value]; + return true; + } + module.error(errors.method); + return false; + }); + } + if ( $.isFunction( found ) ) { + module.verbose('Executing invoked function', found); + return found.apply(context, passedArguments); + } + return found || false; + } + }; + + if(methodInvoked) { + if(instance === undefined) { + module.initialize(); + } + invokedResponse = module.invoke(query); + } + else { + if(instance !== undefined) { + module.destroy(); + } + module.initialize(); + } + }) + ; + return (invokedResponse) + ? invokedResponse + : this + ; +}; + +$.fn.carousel.settings = { + + moduleName : 'Carousel Module', + namespace : 'carousel', + + verbose : true, + debug : true, + performance : true, + + // delegated event context + duration: 5000, + + errors : { + method : 'The method you called is not defined.' + }, + + selector : { + arrows : '.arrow', + leftArrow : '.left.arrow', + rightArrow : '.right.arrow', + content : '.content', + navigation : '.navigation', + navItem : '.navigation .icon' + }, + + className : { + active : 'active' + } + +}; + +})( jQuery, window , document ); diff --git a/src/modules/carousel.css b/src/modules/carousel.css new file mode 100755 index 000000000..d4f54112c --- /dev/null +++ b/src/modules/carousel.css @@ -0,0 +1,23 @@ + +.ui.carousel .throbber { + position: absolute; + top: 219px; + left: 446px; + display: none; + background: url(../images/welcome/throbber.gif) no-repeat 0px 0px; + width: 32px; + height: 32px; + z-index: 9999; +} + + + +/* loading state */ +.ui.loading.carousel .select, +.ui.loading.carousel .arrow, +.ui.loading.carousel .slide { + visibility: hidden; +} +.ui.loading.carousel .throbber { + display: block; +} \ No newline at end of file diff --git a/src/modules/carousel.js b/src/modules/carousel.js new file mode 100755 index 000000000..e95867e0f --- /dev/null +++ b/src/modules/carousel.js @@ -0,0 +1,325 @@ +/* ****************************** + Semantic Module: Carousel + Author: Jack Lukic + Notes: First Commit May 28, 2013 + + A carousel alternates between + several pieces of content in sequence. + +****************************** */ + +;(function ( $, window, document, undefined ) { + +$.fn.carousel = function(parameters) { + var + $allModules = $(this), + + settings = $.extend(true, {}, $.fn.carousel.settings, parameters), + + eventNamespace = '.' + settings.namespace, + moduleNamespace = 'module-' + settings.namespace, + moduleSelector = $allModules.selector || '', + + time = new Date().getTime(), + performance = [], + + query = arguments[0], + methodInvoked = (typeof query == 'string'), + queryArguments = [].slice.call(arguments, 1), + invokedResponse + ; + + $allModules + .each(function() { + var + $module = $(this), + $arrows = $(settings.selector.arrows), + $leftArrow = $(settings.selector.leftArrow), + $rightArrow = $(settings.selector.rightArrow), + $content = $(settings.selector.content), + $navigation = $(settings.selector.navigation), + $navItem = $(settings.selector.navItem), + + selector = $module.selector || '', + element = this, + instance = $module.data('module-' + settings.namespace), + + className = settings.className, + namespace = settings.namespace, + errors = settings.errors, + module + ; + + module = { + + initialize: function() { + module.openingAnimation(); + module.marquee.autoAdvance(); + $leftArrow + .on('click', module.marquee.left) + ; + $rightArrow + .on('click', module.marquee.right) + ; + $navItem + .on('click', module.marquee.change) + ; + }, + + destroy: function() { + module.verbose('Destroying previous module for', $module); + $module + .off(namespace) + ; + }, + + left: function() { + var + $activeContent = $content.filter('.' + className.active), + currentIndex = $content.index($activeContent), + imageCount = $content.size(), + newIndex = (currentIndex - 1 != -1) + ? (currentIndex - 1) + : (imageCount - 1) + ; + $navItem + .eq(newIndex) + .trigger('click') + ; + }, + + right: function() { + var + $activeContent = $content.filter('.' + className.active), + currentIndex = $content.index($activeContent), + imageCount = $content.size(), + newIndex = (currentIndex + 1 != imageCount) + ? (currentIndex + 1) + : 0 + ; + $navItem + .eq(newIndex) + .trigger('click') + ; + }, + + change: function() { + var + $selected = $(this), + selectedIndex = $navItem.index($selected), + $selectedImage = $content.eq(selectedIndex) + ; + module.marquee.autoAdvance(); + $selected + .addClass('active') + .siblings() + .removeClass('active') + ; + $selectedImage + .addClass('active animated fadeIn') + .siblings('.' + className.active) + .removeClass('animated fadeIn scaleIn') + .animate({ + opacity: 0 + }, 500, function(){ + $(this) + .removeClass('active') + .removeAttr('style') + ; + }) + ; + }, + + autoAdvance: function() { + clearInterval(module.timer); + module.timer = setInterval(module.marquee.right, settings.duration); + }, + + setting: function(name, value) { + if(value !== undefined) { + if( $.isPlainObject(name) ) { + module.verbose('Modifying settings object', name, value); + $.extend(true, settings, name); + } + else { + module.verbose('Modifying setting', name, value); + settings[name] = value; + } + } + else { + return settings[name]; + } + }, + internal: function(name, value) { + if(value !== undefined) { + if( $.isPlainObject(name) ) { + module.verbose('Modifying internal property', name, value); + $.extend(true, module, name); + } + else { + module.verbose('Changing internal method to', value); + module[name] = value; + } + } + else { + return module[name]; + } + }, + debug: function() { + if(settings.debug) { + if(settings.performance) { + module.performance.log(arguments); + } + else { + module.debug = Function.prototype.bind.call(console.info, console, settings.moduleName + ':'); + } + } + }, + verbose: function() { + if(settings.verbose && settings.debug) { + if(settings.performance) { + module.performance.log(arguments); + } + else { + module.verbose = Function.prototype.bind.call(console.info, console, settings.moduleName + ':'); + } + } + }, + error: function() { + module.error = Function.prototype.bind.call(console.log, console, settings.moduleName + ':'); + }, + performance: { + log: function(message) { + var + currentTime, + executionTime, + previousTime + ; + if(settings.performance) { + currentTime = new Date().getTime(); + previousTime = time || currentTime, + executionTime = currentTime - previousTime; + time = currentTime; + performance.push({ + 'Element' : element, + 'Name' : message[0], + 'Arguments' : message[1] || 'None', + 'Execution Time' : executionTime + }); + clearTimeout(module.performance.timer); + module.performance.timer = setTimeout(module.performance.display, 100); + } + }, + display: function() { + var + title = settings.moduleName, + caption = settings.moduleName + ': ' + moduleSelector + '(' + $allModules.size() + ' elements)', + totalExecutionTime = 0 + ; + if(moduleSelector) { + title += ' Performance (' + moduleSelector + ')'; + } + if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) { + console.groupCollapsed(title); + if(console.table) { + $.each(performance, function(index, data) { + totalExecutionTime += data['Execution Time']; + }); + console.table(performance); + } + else { + $.each(performance, function(index, data) { + totalExecutionTime += data['Execution Time']; + console.log(data['Name'] + ': ' + data['Execution Time']+'ms'); + }); + } + console.log('Total Execution Time:', totalExecutionTime +'ms'); + console.groupEnd(); + performance = []; + time = false; + } + } + }, + invoke: function(query, passedArguments, context) { + var + maxDepth, + found + ; + passedArguments = passedArguments || queryArguments; + context = element || context; + if(typeof query == 'string' && instance !== undefined) { + query = query.split('.'); + maxDepth = query.length - 1; + $.each(query, function(depth, value) { + if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { + instance = instance[value]; + return true; + } + else if( instance[value] !== undefined ) { + found = instance[value]; + return true; + } + module.error(errors.method); + return false; + }); + } + if ( $.isFunction( found ) ) { + module.verbose('Executing invoked function', found); + return found.apply(context, passedArguments); + } + return found || false; + } + }; + + if(methodInvoked) { + if(instance === undefined) { + module.initialize(); + } + invokedResponse = module.invoke(query); + } + else { + if(instance !== undefined) { + module.destroy(); + } + module.initialize(); + } + }) + ; + return (invokedResponse) + ? invokedResponse + : this + ; +}; + +$.fn.carousel.settings = { + + moduleName : 'Carousel Module', + namespace : 'carousel', + + verbose : true, + debug : true, + performance : true, + + // delegated event context + duration: 5000, + + errors : { + method : 'The method you called is not defined.' + }, + + selector : { + arrows : '.arrow', + leftArrow : '.left.arrow', + rightArrow : '.right.arrow', + content : '.content', + navigation : '.navigation', + navItem : '.navigation .icon' + }, + + className : { + active : 'active' + } + +}; + +})( jQuery, window , document );