/*!
* ionic.bundle.js is a concatenation of:
* ionic.js, angular.js, angular-animate.js,
* angular-sanitize.js, angular-ui-router.js,
* and ionic-angular.js
*/
/*!
* Copyright 2015 Drifty Co.
* http://drifty.com/
*
* Ionic, v1.3.3
* A powerful HTML5 mobile app framework.
* http://ionicframework.com/
*
* By @maxlynch, @benjsperry, @adamdbradley <3
*
* Licensed under the MIT license. Please see LICENSE for more information.
*
*/
(function() {
// Create global ionic obj and its namespaces
// build processes may have already created an ionic obj
window.ionic = window.ionic || {};
window.ionic.views = {};
window.ionic.version = '1.3.3';
(function (ionic) {
ionic.DelegateService = function(methodNames) {
if (methodNames.indexOf('$getByHandle') > -1) {
throw new Error("Method '$getByHandle' is implicitly added to each delegate service. Do not list it as a method.");
}
function trueFn() { return true; }
return ['$log', function($log) {
/*
* Creates a new object that will have all the methodNames given,
* and call them on the given the controller instance matching given
* handle.
* The reason we don't just let $getByHandle return the controller instance
* itself is that the controller instance might not exist yet.
*
* We want people to be able to do
* `var instance = $ionicScrollDelegate.$getByHandle('foo')` on controller
* instantiation, but on controller instantiation a child directive
* may not have been compiled yet!
*
* So this is our way of solving this problem: we create an object
* that will only try to fetch the controller with given handle
* once the methods are actually called.
*/
function DelegateInstance(instances, handle) {
this._instances = instances;
this.handle = handle;
}
methodNames.forEach(function(methodName) {
DelegateInstance.prototype[methodName] = instanceMethodCaller(methodName);
});
/**
* The delegate service (eg $ionicNavBarDelegate) is just an instance
* with a non-defined handle, a couple extra methods for registering
* and narrowing down to a specific handle.
*/
function DelegateService() {
this._instances = [];
}
DelegateService.prototype = DelegateInstance.prototype;
DelegateService.prototype._registerInstance = function(instance, handle, filterFn) {
var instances = this._instances;
instance.$$delegateHandle = handle;
instance.$$filterFn = filterFn || trueFn;
instances.push(instance);
return function deregister() {
var index = instances.indexOf(instance);
if (index !== -1) {
instances.splice(index, 1);
}
};
};
DelegateService.prototype.$getByHandle = function(handle) {
return new DelegateInstance(this._instances, handle);
};
return new DelegateService();
function instanceMethodCaller(methodName) {
return function caller() {
var handle = this.handle;
var args = arguments;
var foundInstancesCount = 0;
var returnValue;
this._instances.forEach(function(instance) {
if ((!handle || handle == instance.$$delegateHandle) && instance.$$filterFn(instance)) {
foundInstancesCount++;
var ret = instance[methodName].apply(instance, args);
//Only return the value from the first call
if (foundInstancesCount === 1) {
returnValue = ret;
}
}
});
if (!foundInstancesCount && handle) {
return $log.warn(
'Delegate for handle "' + handle + '" could not find a ' +
'corresponding element with delegate-handle="' + handle + '"! ' +
methodName + '() was not called!\n' +
'Possible cause: If you are calling ' + methodName + '() immediately, and ' +
'your element with delegate-handle="' + handle + '" is a child of your ' +
'controller, then your element may not be compiled yet. Put a $timeout ' +
'around your call to ' + methodName + '() and try again.'
);
}
return returnValue;
};
}
}];
};
})(window.ionic);
(function(window, document, ionic) {
var readyCallbacks = [];
var isDomReady = document.readyState === 'complete' || document.readyState === 'interactive';
function domReady() {
isDomReady = true;
for (var x = 0; x < readyCallbacks.length; x++) {
ionic.requestAnimationFrame(readyCallbacks[x]);
}
readyCallbacks = [];
document.removeEventListener('DOMContentLoaded', domReady);
}
if (!isDomReady) {
document.addEventListener('DOMContentLoaded', domReady);
}
// From the man himself, Mr. Paul Irish.
// The requestAnimationFrame polyfill
// Put it on window just to preserve its context
// without having to use .call
window._rAF = (function() {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
function(callback) {
window.setTimeout(callback, 16);
};
})();
var cancelAnimationFrame = window.cancelAnimationFrame ||
window.webkitCancelAnimationFrame ||
window.mozCancelAnimationFrame ||
window.webkitCancelRequestAnimationFrame;
/**
* @ngdoc utility
* @name ionic.DomUtil
* @module ionic
*/
ionic.DomUtil = {
//Call with proper context
/**
* @ngdoc method
* @name ionic.DomUtil#requestAnimationFrame
* @alias ionic.requestAnimationFrame
* @description Calls [requestAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/window.requestAnimationFrame), or a polyfill if not available.
* @param {function} callback The function to call when the next frame
* happens.
*/
requestAnimationFrame: function(cb) {
return window._rAF(cb);
},
cancelAnimationFrame: function(requestId) {
cancelAnimationFrame(requestId);
},
/**
* @ngdoc method
* @name ionic.DomUtil#animationFrameThrottle
* @alias ionic.animationFrameThrottle
* @description
* When given a callback, if that callback is called 100 times between
* animation frames, adding Throttle will make it only run the last of
* the 100 calls.
*
* @param {function} callback a function which will be throttled to
* requestAnimationFrame
* @returns {function} A function which will then call the passed in callback.
* The passed in callback will receive the context the returned function is
* called with.
*/
animationFrameThrottle: function(cb) {
var args, isQueued, context;
return function() {
args = arguments;
context = this;
if (!isQueued) {
isQueued = true;
ionic.requestAnimationFrame(function() {
cb.apply(context, args);
isQueued = false;
});
}
};
},
contains: function(parentNode, otherNode) {
var current = otherNode;
while (current) {
if (current === parentNode) return true;
current = current.parentNode;
}
},
/**
* @ngdoc method
* @name ionic.DomUtil#getPositionInParent
* @description
* Find an element's scroll offset within its container.
* @param {DOMElement} element The element to find the offset of.
* @returns {object} A position object with the following properties:
* - `{number}` `left` The left offset of the element.
* - `{number}` `top` The top offset of the element.
*/
getPositionInParent: function(el) {
return {
left: el.offsetLeft,
top: el.offsetTop
};
},
getOffsetTop: function(e
没有合适的资源?快使用搜索试试~ 我知道了~
ionic开发混合手机应用
共23个文件
js:16个
css:2个
woff:1个
3星 · 超过75%的资源 需积分: 9 8 下载量 143 浏览量
2017-07-02
16:37:21
上传
评论 1
收藏 6.71MB ZIP 举报
温馨提示
ionic是一个用来开发混合手机应用的,开源的,免费的代码库。可以优化html、css和js的性能,构建高效的应用程序,而且还可以用于构建Sass和AngularJS的优化,基于PhoneGap的编译平台,可以实现编译成各个平台的应用程序。 ionic的开发添加android和ios环境。 ionic提供很多css组件[2] 和javascript UI库。 ionic可以支持定制android和ios的插件,也支持服务端REST的敏捷开发。
资源推荐
资源详情
资源评论
收起资源包目录
ionic-v1.3.3.zip (23个子文件)
css
ionic.min.css 195KB
ionic.css 247KB
version.json 96B
fonts
ionicons.eot 118KB
ionicons.svg 326KB
ionicons.ttf 184KB
ionicons.woff 66KB
js
angular-ui
angular-ui-router.min.js 28KB
angular-ui-router.js 153KB
ionic-angular.min.js 123KB
ionic-angular.js 450KB
ionic.min.js 163KB
ionic.bundle.min.js 498KB
angular
angular-animate.min.js 25KB
angular-sanitize.min.js 6KB
angular-sanitize.js 25KB
angular-resource.min.js 4KB
angular-resource.js 31KB
angular.min.js 152KB
angular.js 1.09MB
angular-animate.js 146KB
ionic.js 461KB
ionic.bundle.js 2.3MB
共 23 条
- 1
资源评论
- 迪恩温2017-08-29假的,不是书籍,下载的东西只有1.6M 骗下载分的,
- 丑陋的小可怜2018-01-31我看看是不是骗人的吧
AlanMaya
- 粉丝: 14
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功