/** * Copyright <%= year %> Telerik AD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ !function(e,define){define(["./kendo.mobile.pane.min","./kendo.router.min"],e)}(function(){return function(e,t){function n(e,t){var n=[];return p&&n.push("km-on-"+p.name),e.skin?n.push("km-"+e.skin):"ios"==e.name&&e.majorVersion>6?n.push("km-ios7"):n.push("km-"+e.name),("ios"==e.name&&7>e.majorVersion||"ios"!=e.name)&&n.push("km-"+e.name+e.majorVersion),n.push("km-"+e.majorVersion),n.push("km-m"+(e.minorVersion?e.minorVersion[0]:0)),e.variant&&n.push("km-"+(e.skin?e.skin:e.name)+"-"+e.variant),e.cordova&&n.push("km-cordova"),e.appMode?n.push("km-app"):n.push("km-web"),t&&t.statusBarStyle&&n.push("km-"+t.statusBarStyle+"-status-bar"),n.join(" ")}function i(){return 0===parseInt(e("
").css("background-color").split(",")[1],10)?"dark":"light"}function o(e){return p.wp?"-kendo-landscape"==e.css("animation-name"):Math.abs(window.orientation)/90==1}function r(e){return o(e)?y:g}function a(e){e.parent().addBack().css("min-height",window.innerHeight)}function s(){e("meta[name=viewport]").remove(),F.append(b({height:", width=device-width"+(o()?", height="+window.innerHeight+"px":c.mobileOS.flatVersion>=600&&700>c.mobileOS.flatVersion?", height="+window.innerWidth+"px":", height=device-height")}))}var l=window.kendo,d=l.mobile,c=l.support,u=d.ui.Pane,h="ios7",p=c.mobileOS,f="blackberry"==p.device&&p.flatVersion>=600&&1e3>p.flatVersion&&p.appMode,g="km-vertical",m="chrome"===p.browser,v=p.ios&&p.flatVersion>=700&&(p.appMode||m),_=Math.abs(window.orientation)/90==1,y="km-horizontal",w={ios7:{ios:!0,browser:"default",device:"iphone",flatVersion:"700",majorVersion:"7",minorVersion:"0.0",name:"ios",tablet:!1},ios:{ios:!0,browser:"default",device:"iphone",flatVersion:"612",majorVersion:"6",minorVersion:"1.2",name:"ios",tablet:!1},android:{android:!0,browser:"default",device:"android",flatVersion:"442",majorVersion:"4",minorVersion:"4.2",name:"android",tablet:!1},blackberry:{blackberry:!0,browser:"default",device:"blackberry",flatVersion:"710",majorVersion:"7",minorVersion:"1.0",name:"blackberry",tablet:!1},meego:{meego:!0,browser:"default",device:"meego",flatVersion:"850",majorVersion:"8",minorVersion:"5.0",name:"meego",tablet:!1},wp:{wp:!0,browser:"default",device:"wp",flatVersion:"800",majorVersion:"8",minorVersion:"0.0",name:"wp",tablet:!1}},b=l.template('',{usedWithBlock:!1}),k=l.template(' ',{usedWithBlock:!1}),x=l.template("",{usedWithBlock:!1}),C=p.android&&"chrome"!=p.browser||p.blackberry,T=b({height:""}),S=l.template('',{usedWithBlock:!1}),D=("iphone"==p.device||"ipod"==p.device)&&7>p.majorVersion,A=("iphone"==p.device||"ipod"==p.device)&&p.majorVersion>=7,E=A?"none":null,P="mobilesafari"==p.browser?60:0,z=20,I=e(window),M=window.screen,F=e("head"),L="init",B=e.proxy,R=l.Observable.extend({init:function(t,n){var i=this;d.application=i,i.options=e.extend({hideAddressBar:!0,useNativeScrolling:!1,statusBarStyle:"black",transition:"",historyTransition:E,updateDocumentTitle:!0},n),l.Observable.fn.init.call(i,i.options),i.bind(i.events,i.options),e(function(){t=e(t),i.element=t[0]?t:e(document.body),i._setupPlatform(),i._attachMeta(),i._setupElementClass(),i._attachHideBarHandlers(),i.pane=new u(i.element,i.options),i.pane.navigateToInitial(),i.options.updateDocumentTitle&&i._setupDocumentTitle(),i._startHistory(),i.trigger(L)})},events:[L],navigate:function(e,t){this.pane.navigate(e,t)},replace:function(e,t){this.pane.replace(e,t)},scroller:function(){return this.view().scroller},hideLoading:function(){if(!this.pane)throw Error("The mobile application instance is not fully instantiated. Please consider activating loading in the application init event handler.");this.pane.hideLoading()},showLoading:function(){if(!this.pane)throw Error("The mobile application instance is not fully instantiated. Please consider activating loading in the application init event handler.");this.pane.showLoading()},changeLoadingMessage:function(e){if(!this.pane)throw Error("The mobile application instance is not fully instantiated. Please consider changing the message in the application init event handler.");this.pane.changeLoadingMessage(e)},view:function(){return this.pane.view()},skin:function(e){var t=this;return arguments.length?(t.options.skin=e||"",t.element[0].className="km-pane",t._setupPlatform(),t._setupElementClass(),t.options.skin):t.options.skin},destroy:function(){this.pane.destroy(),this.router.destroy()},_setupPlatform:function(){var t,o=this,r=o.options.platform,a=o.options.skin,s=[],l=p||w[h];r&&("string"==typeof r?(s=r.split("-"),l=e.extend({variant:s[1]},l,w[s[0]])):l=r),a&&(s=a.split("-"),l=e.extend({},l,{skin:s[0],variant:s[1]})),o.os=l,o.osCssClass=n(o.os,o.options),l.wp&&(t&&(e(window).off("focusin",t),document.removeEventListener("resume",t)),l.skin||(o.element.parent().css("overflow","hidden"),t=function(){o.element.removeClass("km-wp-dark km-wp-light").addClass("km-wp-"+i())},e(window).on("focusin",t),document.addEventListener("resume",t),t()))},_startHistory:function(){this.router=new l.Router({pushState:this.options.pushState,root:this.options.root,hashBang:this.options.hashBang}),this.pane.bindToRouter(this.router),this.router.start()},_resizeToScreenHeight:function(){var t,n=e("meta[name=apple-mobile-web-app-status-bar-style]").attr("content").match(/black-translucent|hidden/),i=this.element;t=m?window.innerHeight:o(i)?n?_?M.availWidth+z:M.availWidth:_?M.availWidth:M.availWidth-z:n?_?M.availHeight:M.availHeight+z:_?M.availHeight-z:M.availHeight,i.height(t)},_setupElementClass:function(){var t,n=this,i=n.element;i.parent().addClass("km-root km-"+(n.os.tablet?"tablet":"phone")),i.addClass(n.osCssClass+" "+r(i)),this.options.useNativeScrolling&&i.parent().addClass("km-native-scrolling"),m&&i.addClass("km-ios-chrome"),c.wpDevicePixelRatio&&i.parent().css("font-size",c.wpDevicePixelRatio+"em"),f&&s(),n.options.useNativeScrolling?i.parent().addClass("km-native-scrolling"):C&&(t=(screen.availWidth>screen.availHeight?screen.availWidth:screen.availHeight)+200,e(x({width:t,height:t})).appendTo(F)),v&&n._resizeToScreenHeight(),l.onResize(function(){i.removeClass("km-horizontal km-vertical").addClass(r(i)),n.options.useNativeScrolling&&a(i),v&&n._resizeToScreenHeight(),f&&s(),l.resize(i)})},_clearExistingMeta:function(){F.find("meta").filter("[name|='apple-mobile-web-app'],[name|='msapplication-tap'],[name='viewport']").remove()},_attachMeta:function(){var e,t=this.options,n=t.icon;if(this._clearExistingMeta(),f||F.prepend(T),F.prepend(k(t)),n){"string"==typeof n&&(n={"":n});for(e in n)F.prepend(S({icon:n[e],size:e}))}t.useNativeScrolling&&a(this.element)},_attachHideBarHandlers:function(){var e=this,t=B(e,"_hideBar");!c.mobileOS.appMode&&e.options.hideAddressBar&&D&&!e.options.useNativeScrolling&&(e._initialHeight={},I.on("load",t),l.onResize(function(){setTimeout(window.scrollTo,0,0,1)}))},_setupDocumentTitle:function(){var e=this,n=document.title;e.pane.bind("viewShow",function(e){var i=e.view.title;document.title=i!==t?i:n})},_hideBar:function(){var t=this,n=t.element;n.height(l.support.transforms.css+"calc(100% + "+P+"px)"),e(window).trigger(l.support.resize)}});l.mobile.Application=R}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});