/*! intel-appframework - v3.0.0 - 2014-10-16 */ /* Intel 2014 @author Ian Maffett @description jQuery helper functions for App Framework 2011-2014 Intel @author Intel @version 3.0 2014 Intel Intel 2014 Intel 2014 Intel 2014 Intel 2014 Intel 2014 */ (function(a,f){function h(a,c){if(a)if(a.nodeType)c[c.length++]=a;else for(var d=0,b=a.length;dd.clientHeight,e="touch"===a(d).computedStyle("-webkit-overflow-scrolling"),g="hidden"!==a(d).computedStyle("overflowY"), k=parseInt(a(d).computedStyle("height"),10);b&&(e&&g)&&(b=c.touches[0].screenY,k=this._startTouchY>=b&&d.scrollHeight-d.scrollTop===k,(this._startTouchY<=b&&0===d.scrollTop||k)&&c.preventDefault())}},registerDataDirective:function(a,d){b.push({sel:a,cb:d})},enableTabBar:function(){a(document).on("click",".button-grouped.tabbed",function(c){var d=a(c.target);d.closest(".tabbed").find(".button").data("ignore-pressed","true").removeClass("pressed");d.closest(".button").addClass("pressed");setTimeout(function(){d.closest(".button").addClass("pressed")})})}, disableTabBar:function(){a(document).off("click",".button-grouped.tabbed");a(".button-grouped.tabbed .button").removeAttr("data-ignore-pressed")},manageHistory:!0,loadDefaultHash:!0,actionsheet:function(c){return a.query(document.body).actionsheet(c)},popup:function(c){return a.query(document.body).popup(c)},blockUI:function(c){a.blockUI(c)},unblockUI:function(){a.unblockUI()},autoLaunch:!0,ready:function(c){if(this.launchCompleted)c();else a(document).one("afui:ready",function(){c()})},goBack:function(c){var d= a(this.activeDiv).closest(".view");c&&c.target&&(d=a(c.target).closest(".view"));if(0!==d.length&&this.views[d.prop("id")]){var b=this.views[d.prop("id")];if(0!==b.length&&(c=b.pop(),0!==c.length))if(0h1").html(c);a.query("#afui_mask").show()},hideMask:function(){a.query("#afui_mask").hide()},dismissView:function(c,d){d=d.replace(":dismiss","");var b=a(c).closest(".view");this.runTransition(d,b,null,!0,a(c.hash).addClass("active").closest(".view"));this.activeDiv=a(".view").not(b).find(".panel.active").get(0);this.updateHash(this.activeDiv.id)},loadContent:function(a,d,b,e,g){this.doingTransition||0!==a.length&&(-1!==a.indexOf("#")?this.loadDiv(a,d,b,e,g):this.loadAjax(a, d,b,e,g))},loadDiv:function(c,d,b,e,g){var k=c.replace("#",""),f=k.indexOf("/");-1!==f&&(k.substr(f),k=k.substr(0,f));if(k=a.query("#"+k).get(0))if(k===this.activeDiv&&!b)this.doingTransition=!1;else{this.transitionType=e;var f=this.findViewTarget(k),h=this.findPreviousPanel(k,f),n=(g=g?this.findViewTarget(g):this.findViewTarget(this.activeDiv))&&g.get(0)!==f.get(0)&&g.closest(".splitview").get(0)===f.closest(".splitview").get(0)&&0!==g.closest(".splitview").length;n&&(d=!1);a(k).trigger("panelbeforeload"); a(h).trigger("panelbeforeunload");var s=!1;n||(n=1===g.parent().closest(".view").length);n&&(g&&g.get(0)!==f.get(0))&&a(g).trigger("nestedviewunload");!n&&(d||g&&g.get(0)!==f.get(0))?(this.runViewTransition(e,f,g||d,k,b),this.updateViewHistory(f,k,e,c),s=!0):(this.runTransition(e,h,k,b),this.updateViewHistory(f,k,e,c));this.loadContentData(k,f,!1,s)}else a(document).trigger("missingpanel",null,{missingTarget:c}),this.doingTransition=!1},findViewTarget:function(c){c=a(c).closest(".view");if(!c)return!1; this.views[c.prop("id")]||(this.views[c.prop("id")]=[]);return c},findPreviousPanel:function(c,d){var b=a(d).find(">.pages .panel.active").not(c);0===b.length&&(b=a(d).find(">.pages .panel:first-of-type"));return b.get(0)},loadContentData:function(a,d,b,e){this.activeDiv=a;this.setTitle(a,d,b,e);this.showBackButton(d,e);this.setActiveTab(a,d)},setActiveTab:function(c,d){var b;"string"!==typeof c&&(b=a(c).prop("id"));b="#"+b;d.find("footer").find("a").removeClass("pressed").attr("data-ignore-pressed", "true").filter("[href='"+b+"']").addClass("pressed")},showBackButton:function(a,d){var b=this.views[a.prop("id")].length,e=a.children("header");0!==e.length&&(2<=b&&!0!==d?1!==e.find(".backButton").length&&e.prepend("Back"):e.find(".backButton").remove())},loadAjax:function(c,d,b,g,f){var k=this,h=e(c),q=a(".panel[data-crc='"+h+"']"),n=f.getAttribute("data-refresh");if(0

Loading Content

"}).css({"z-index":2E4,display:"none"});document.body.appendChild(d.get(0));d=a(".view[data-default='true']");if(0===d.length)d=a(".view").eq(0);else throw"You need to create a view";d.addClass("active");this.views[d.prop("id")]=[];var e=window.location.hash,f=0===d.find(".panel[data-selected='true']").length?d.find(".panel").eq(0): d.find(".panel[data-selected='true']");f.addClass("active");this.activeDiv=f.get(0);this.views[d.prop("id")].push({target:f.get(0),transition:this.transitionType});this.defaultPanel=f.get(0);this.loadContentData(f.get(0),d,!1,!0);this.updateHash(f.get(0).id);this.loadDefaultHash&&setTimeout(function(){this.loadContent(e,!1,0,"none")}.bind(this));this.enableTabBar();a(document).on("click","a",function(a){c.useInternalRouting&&g(a,a.currentTarget)});a(document).on("click",function(d){for(var e=b.length, g=a(d.target),f=0;f>>8^e;return(b^-1)>>>0};a.afui=new h;a.afui.init=!0;a(window).trigger("afui:preinit");a(window).trigger("afui:init")})(jQuery); (function(a){a.fn.actionsheet=function(a){for(var b,g=0;g
"+b+"Cancel
");else if("object"=== typeof b){e=a("
");var c=a(e.children().get(0));b.push({text:"Cancel",cssClasses:"cancel"});for(var d=0;d"+(b[d].text||"TEXT NOT ENTERED")+"");m[0].onclick=b[d].handler||g;b[d].cssClasses&&0");setTimeout(function(){e.vendorCss("Transition","all 300ms");e.cssTranslate("0,0")},10);a("#af_action_mask").bind("touchstart touchmove touchend click",function(a){a.preventDefault();a.stopPropagation()})}else window.alert("Could not find element for actionsheet "+ h)};f.prototype={activeSheet:null,sheetClickHandler:function(){this.hideSheet();return!1},hideSheet:function(){this.activeSheet.off("click","a",this.sheetClickHandler);a(this.el).find("#af_action_mask").unbind("click").remove();this.activeSheet.vendorCss("Transition","all 0ms");var f=this.activeSheet,b=this.el;setTimeout(function(){f.vendorCss("Transition","all 300ms");f.cssTranslate("0,"+(f.height()+60)+"px");setTimeout(function(){f.remove();f=null;b.style.overflow="none"},350)},10)}};a.afui.actionsheet= function(f){return a(document.body).actionsheet(f)}})(jQuery); (function(a){a.afui.registerDataDirective("[data-grower]",function(f,h){var b=a(f).closest("[data-grower]"),g=b.offset(),e=b.closest(".view"),c=h.target.hash||b.attr("data-grower");e.css("zIndex","1");var d=a(c).closest(".view"),m=b.width()/window.innerWidth,l=b.height()/window.innerHeight,p={left:g.left,top:g.top,x:m,y:l};a(c).trigger("panelgrowstart",[b.get(0)]);d.addClass("active").css("zIndex","10");d.vendorCss("TransformOrigin","0 0");d.data("growTransProps",p);d.vendorCss("TransitionDuration", "0");d.vendorCss("Transform","translate3d("+g.left+"px,"+g.top+"px,0) scale("+m+","+l+")");d.data("growTarget",b.closest(".panel"));d.data("growFrom",a(c).attr("id"));a.afui.loadContent(c,e,!1,"stretch");a(c).one("panelload",function(){d.vendorCss("Transform","");a(c).trigger("panelgrowcomplete",[b.get(0)])})});a.afui.registerDataDirective("[data-grower-back]",function(f){var h=a(f).closest(".view"),b=a("#"+h.data("growFrom"));b.trigger("panelgrowendstart");f=h.data("growTransProps");var g="#"+h.data("growTarget").prop("id"); a(g).closest(".view").addClass("active");h.addClass("animation-active");h.transition().end(function(){h.removeClass("active");b.trigger("panelgrowendstart");a.afui.loadContent(g,!1,!1,"none")}).run("translate3d("+f.left+"px,"+f.top+"px,0) scale("+f.x+","+f.y+")","300ms")})})(jQuery); (function(a){function f(a,c,b,d){var e=Math.abs(a-c),g=Math.abs(b-d);return e>=g?0=e&&(b.el.trigger("longTap"),b={})}var b={},g,e=750,c,d=!1,m=!1;a(document).ready(function(){var l;a(document.body).bind("touchstart",function(f){f.originalEvent&&(f=f.originalEvent);if(f.touches&&0!==f.touches.length){var k=Date.now(),r=k-(b.last||k);f.touches&&0!==f.touches.length&&(b.el=a("tagName"in f.touches[0].target?f.touches[0].target: f.touches[0].target.parentNode),g&&clearTimeout(g),b.x1=f.touches[0].pageX,b.y1=f.touches[0].pageY,b.x2=b.y2=0,0=r&&(b.isDoubleTap=!0),b.last=k,c=setTimeout(h,e),a.afui.useAutoPressed&&!b.el.attr("data-ignore-pressed")&&b.el.addClass("pressed"),l&&(a.afui.useAutoPressed&&!l.attr("data-ignore-pressed")&&l[0]!==b.el[0])&&l.removeClass("pressed"),l=b.el,m=d=!1)}}).bind("touchmove",function(e){e.originalEvent&&(e=e.originalEvent);b.x2=e.touches[0].pageX;b.y2=e.touches[0].pageY;if(!m&&(5"+g+""), b.append(c),c.animation().end(function(){a(this).remove()}).run(e)))}:f}})(jQuery); (function(a){a.fn.popup=function(a){return new h(this[0],a)};var f=[],h=function(b,e){if(this.container="string"===typeof b||b instanceof String?document.getElementById(b):b)try{if("string"===typeof e||"number"===typeof e)e={message:e,cancelOnly:"true",cancelText:"OK"};this.id=e.id=e.id||a.uuid();this.addCssClass=e.addCssClass?e.addCssClass:"";this.suppressTitle=e.suppressTitle||this.suppressTitle;this.title=e.suppressTitle?"":e.title||"Alert";this.message=e.message||"";this.cancelText=e.cancelText|| "Cancel";this.cancelCallback=e.cancelCallback||function(){};this.cancelClass=e.cancelClass||"button";this.doneText=e.doneText||"Done";this.doneCallback=e.doneCallback||function(){};this.doneClass=e.doneClass||"button";this.cancelOnly=e.cancelOnly||!1;this.onShow=e.onShow||function(){};this.autoCloseDone=void 0!==e.autoCloseDone?e.autoCloseDone:!0;f.push(this);1===f.length&&this.show()}catch(c){console.log("error adding popup "+c)}else window.alert("Error finding container for popup "+b)};h.prototype= {id:null,addCssClass:null,title:null,message:null,cancelText:null,cancelCallback:null,cancelClass:null,doneText:null,doneCallback:null,doneClass:null,cancelOnly:!1,onShow:null,autoCloseDone:!0,suppressTitle:!1,show:function(){var b=this,e=a("");a(this.container).append(e);e.bind("close",function(){b.hide()});this.cancelOnly&&(e.find("A#action").hide(),e.find("A#cancel").addClass("center"));e.find("A").each(function(){var c=a(this);c.bind("click",function(a){"cancel"===c.attr("id")?(b.cancelCallback.call(b.cancelCallback,b),b.hide()):(b.doneCallback.call(b.doneCallback,b),b.autoCloseDone&&b.hide());a.preventDefault()})});b.positionPopup();a.blockUI(0.5);e.bind("orientationchange", function(){b.positionPopup()});e.find("header").show();e.find("footer").show();setTimeout(function(){e.removeClass("hidden").addClass("show");b.onShow(b)},50)},hide:function(){var b=this;a.query("#"+b.id).addClass("hidden");a.unblockUI();!a.os.ie&&!a.os.android?setTimeout(function(){b.remove()},250):b.remove()},remove:function(){var b=a.query("#"+this.id);b.unbind("close");b.find("BUTTON#action").unbind("click");b.find("BUTTON#cancel").unbind("click");b.unbind("orientationchange").remove();f.splice(0, 1);0")),a.query("BODY DIV#mask").bind("touchstart",function(a){a.preventDefault()}),a.query("BODY DIV#mask").bind("touchmove",function(a){a.preventDefault()}),b=!0)}; a.unblockUI=function(){b=!1;a.query("BODY DIV#mask").unbind("touchstart");a.query("BODY DIV#mask").unbind("touchmove");a("BODY DIV#mask").remove()};a.afui.registerDataDirective("[data-alert]",function(b){b=a(b).attr("data-message");0!==b.length&&a(document.body).popup(b)});a.afui.popup=function(b){return a(document.body).popup(b)}})(jQuery); (function(a){function f(a){this.element=a;this.element.classList.remove("animation-reverse");this.keepClass=!1}function h(a){this.element=a;this.element}a.fn.animation=function(){var a=this;this.each(function(){a=new f(this)});return a};var b=function(a){this.element.removeEventListener("webkitAnimationEnd",this.endCBCache,!1);this.element.removeEventListener("animationend",this.endCBCache,!1);this.element.removeEventListener("MSAnimationEnd",this.endCBCache,!1);this.endcb&&this.endcb.call(this.element, a);this.element.classList.remove("animation-reverse");this.element.classList.remove("animation-active");this.keepClass||this.element.classList.remove(this.animClass)};f.prototype={element:null,animClass:null,runEnd:!1,keepClass:!1,keep:function(){this.keepClass=!0;return this},remove:function(a){this.element.classList.remove(a);this.element.offsetWidth=this.element.offsetWidth;return this},endCBCache:null,run:function(a,c){this.runEnd=!1;this.element.classList.add("animation-active");this.element.offsetWidth= this.element.offsetWidth;this.element.classList.add(a);this.animClass=a;var d=window.getComputedStyle(this.element,null),g=d.animation-c;g||(g=d.animationDuration);g||(g=d.MozAnimationDuration);g||(g=d.webkitAnimationDuration);g=parseFloat(g);if(0.01>=g||isNaN(g))this.runEnd=!0;this.endCBCache=b.bind(this);if(this.runEnd)return this.endCBCache(),this;this.element.addEventListener("webkitAnimationEnd",this.endCBCache,!1);this.element.addEventListener("animationend",this.endCBCache,!1);this.element.addEventListener("MSAnimationEnd", this.endCBCache,!1);return this},reverse:function(){this.element.classList.add("animation-reverse");return this},reRun:function(a){this.remove(a);return this.run(a)},endcb:function(){},end:function(a){this.endcb=a;return this}};a.fn.transition=function(){var a=this;this.each(function(){a=new h(this)});return a};var g=function(b){clearTimeout(this.timer);this.element.removeEventListener("webkitTransitionEnd",this.endCBCache,!1);this.element.removeEventListener("transitionend",this.endCBCache,!1);this.element.removeEventListener("MSTransitionEnd", this.endCBCache,!1);this.endcb&&this.endcb.call(this.element,b);this.keepEnd||(a(this.element).vendorCss("TransitionDuration",""),a(this.element).vendorCss("Transform",""))};h.prototype={element:null,runEnd:!1,keepEnd:!1,keep:function(){this.keepEnd=!0;return this},endCBCache:null,timer:null,run:function(b,c){this.endCBCache=g.bind(this);this.element.addEventListener("webkitTransitionEnd",this.endCBCache,!1);this.element.addEventListener("transitionend",this.endCBCache,!1);this.element.addEventListener("MSTransitionEnd", this.endCBCache,!1);a(this.element).vendorCss("TransitionDuration",c);a(this.element).vendorCss("Transform",b);this.timer=setTimeout(function(){this.endCBCache()}.bind(this),parseInt(c,10)+50);return this},endcb:function(){},end:function(a){this.endcb=a;return this}}})(jQuery);(function(a){a.afui.ready(function(){setTimeout(function(){a("#splashscreen").remove()},250)})})(jQuery); (function(a){function f(){return this}var h=null,b,g={push:function(b,c,d){b=a(b).closest(".view").children().filter(":not(nav):not(aside)");d=d||h;for(var g=0;ga.afui.swipeThreshold&&(g=0);f.transition().keep().end(function(){f=g=null}).run("translate3d("+-g+"px,0px,0)","100ms")}))});var e=function(a){a=-(h-a.touches[0].pageX);a<-g?a="-"+g:0");this.container=this.container.find(".afToastContainer");this.container.removeClass("tr br tl bl tc bc").addClass(this.addCssClass);!1===g.autoClose&&(this.autoClose=!1);this.show()}else window.alert("Error finding container for toast "+b)};f.prototype={addCssClass:null,message:null,delay:5E3,el:null,container:null,timer:null,autoClose:!0,show:function(){var b=this;this.el=a("
"+this.message+"
").get(0); this.container.append(this.el);var g=a(this.el),e=this.el.clientHeight;g.addClass("hidden");setTimeout(function(){g.css("height",e);g.removeClass("hidden")},20);this.autoClose&&(this.timer=setTimeout(function(){b.hide()},this.delay));g.bind("click",function(){b.hide()})},hide:function(){var b=this;clearTimeout(this.timer);a(this.el).unbind("click").addClass("hidden");a(this.el).css("height","0px");!a.os.ie&&!a.os.android?setTimeout(function(){b.remove()},300):b.remove()},remove:function(){a(this.el).remove()}}; return f}();a.afui.toast=function(f){a(document.body).toast(f)};a.afui.registerDataDirective("[data-toast]",function(f){var b=a(f);f=b.attr("data-message")||"";if(0!==f.length){var g=b.attr("data-position")||"tr",e=b.attr("data-type"),c="false"===b.attr("data-auto-close")?!1:!0,b=b.attr("data-delay")||0;f={message:f,position:g,delay:b,autoClose:c,type:e};a(document.body).toast(f)}})})(jQuery);