aurelia-mobile-plugin
Advanced tools
Comparing version 0.0.0 to 0.0.1
@@ -1,2 +0,2 @@ | ||
define(['exports', 'fast-click'], function (exports, _fastClick) { | ||
define(['exports', './mo-scroll', './mo-tap', './mo-press', './mo-swipe', 'hammer-timejs'], function (exports, _moScroll, _moTap, _moPress, _moSwipe) { | ||
'use strict'; | ||
@@ -7,17 +7,43 @@ | ||
}); | ||
Object.keys(_moScroll).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function () { | ||
return _moScroll[key]; | ||
} | ||
}); | ||
}); | ||
Object.keys(_moTap).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function () { | ||
return _moTap[key]; | ||
} | ||
}); | ||
}); | ||
Object.keys(_moPress).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function () { | ||
return _moPress[key]; | ||
} | ||
}); | ||
}); | ||
Object.keys(_moSwipe).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function () { | ||
return _moSwipe[key]; | ||
} | ||
}); | ||
}); | ||
exports.configure = configure; | ||
var _fastClick2 = _interopRequireDefault(_fastClick); | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
function configure(aurelia) { | ||
console.warn('Wuiiiiiii configure'); | ||
aurelia.globalResources('./mo-scroll', './mo-tap', './mo-press', './mo-swipe'); | ||
} | ||
function configure(config) { | ||
config.globalResources('./hello-world'); | ||
(0, _fastClick2.default)(); | ||
} | ||
}); |
@@ -6,14 +6,57 @@ 'use strict'; | ||
}); | ||
exports.configure = configure; | ||
var _fastClick = require('fast-click'); | ||
var _moScroll = require('./mo-scroll'); | ||
var _fastClick2 = _interopRequireDefault(_fastClick); | ||
Object.keys(_moScroll).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _moScroll[key]; | ||
} | ||
}); | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _moTap = require('./mo-tap'); | ||
function configure(config) { | ||
config.globalResources('./hello-world'); | ||
Object.keys(_moTap).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _moTap[key]; | ||
} | ||
}); | ||
}); | ||
(0, _fastClick2.default)(); | ||
var _moPress = require('./mo-press'); | ||
Object.keys(_moPress).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _moPress[key]; | ||
} | ||
}); | ||
}); | ||
var _moSwipe = require('./mo-swipe'); | ||
Object.keys(_moSwipe).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _moSwipe[key]; | ||
} | ||
}); | ||
}); | ||
exports.configure = configure; | ||
require('hammer-timejs'); | ||
function configure(aurelia) { | ||
console.warn('Wuiiiiiii configure'); | ||
aurelia.globalResources('./mo-scroll', './mo-tap', './mo-press', './mo-swipe'); | ||
} |
@@ -1,7 +0,12 @@ | ||
import activateFastclick from 'fast-click'; | ||
export function configure(config) { | ||
config.globalResources('./hello-world'); | ||
export * from './mo-scroll'; | ||
export * from './mo-tap'; | ||
export * from './mo-press'; | ||
export * from './mo-swipe'; | ||
activateFastclick(); | ||
import 'hammer-timejs'; | ||
export function configure(aurelia) { | ||
console.warn('Wuiiiiiii configure'); | ||
aurelia.globalResources('./mo-scroll', './mo-tap', './mo-press', './mo-swipe'); | ||
} |
'use strict'; | ||
System.register(['fast-click'], function (_export, _context) { | ||
System.register(['./mo-scroll', './mo-tap', './mo-press', './mo-swipe', 'hammer-timejs'], function (_export, _context) { | ||
"use strict"; | ||
var activateFastclick; | ||
function configure(config) { | ||
config.globalResources('./hello-world'); | ||
activateFastclick(); | ||
function configure(aurelia) { | ||
console.warn('Wuiiiiiii configure'); | ||
aurelia.globalResources('./mo-scroll', './mo-tap', './mo-press', './mo-swipe'); | ||
} | ||
@@ -16,7 +14,37 @@ | ||
return { | ||
setters: [function (_fastClick) { | ||
activateFastclick = _fastClick.default; | ||
}], | ||
setters: [function (_moScroll) { | ||
var _exportObj = {}; | ||
for (var _key in _moScroll) { | ||
if (_key !== "default" && _key !== "__esModule") _exportObj[_key] = _moScroll[_key]; | ||
} | ||
_export(_exportObj); | ||
}, function (_moTap) { | ||
var _exportObj2 = {}; | ||
for (var _key2 in _moTap) { | ||
if (_key2 !== "default" && _key2 !== "__esModule") _exportObj2[_key2] = _moTap[_key2]; | ||
} | ||
_export(_exportObj2); | ||
}, function (_moPress) { | ||
var _exportObj3 = {}; | ||
for (var _key3 in _moPress) { | ||
if (_key3 !== "default" && _key3 !== "__esModule") _exportObj3[_key3] = _moPress[_key3]; | ||
} | ||
_export(_exportObj3); | ||
}, function (_moSwipe) { | ||
var _exportObj4 = {}; | ||
for (var _key4 in _moSwipe) { | ||
if (_key4 !== "default" && _key4 !== "__esModule") _exportObj4[_key4] = _moSwipe[_key4]; | ||
} | ||
_export(_exportObj4); | ||
}, function (_hammerTimejs) {}], | ||
execute: function () {} | ||
}; | ||
}); |
{ | ||
"name": "aurelia-mobile-plugin", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "A starter kit for building an Aurelia plugin.", | ||
@@ -8,3 +8,7 @@ "keywords": [ | ||
"plugin", | ||
"mobile" | ||
"mobile", | ||
"tablet", | ||
"phone", | ||
"hybrid", | ||
"touch" | ||
], | ||
@@ -26,2 +30,7 @@ "homepage": "http://www.w3tec.ch", | ||
"main": "dist/commonjs/index.js", | ||
"scripts": { | ||
"clean": "gulp clean", | ||
"test": "test", | ||
"build": "gulp build" | ||
}, | ||
"repository": { | ||
@@ -74,3 +83,7 @@ "type": "git", | ||
}, | ||
"peerDependencies": {}, | ||
"peerDependencies": { | ||
"hammer-timejs": "^1.1.0", | ||
"hammerjs": "^2.0.8", | ||
"iscroll": "^5.2.0" | ||
}, | ||
"devDependencies": { | ||
@@ -80,3 +93,3 @@ "aurelia-polyfills": "^1.0.0-beta.1.1.0" | ||
"dependencies": { | ||
"fastclick": "^1.0.6", | ||
"hammer-timejs": "^1.1.0", | ||
"hammerjs": "^2.0.8", | ||
@@ -87,6 +100,17 @@ "iscroll": "^5.2.0" | ||
"dependencies": { | ||
"fastclick": "^1.0.6", | ||
"aurelia-framework": "^1.0.2", | ||
"hammer-timejs": "^1.1.0", | ||
"hammerjs": "^2.0.8", | ||
"iscroll": "^5.2.0" | ||
}, | ||
"aurelia": { | ||
"build": { | ||
"resources": [ | ||
"mo-scroll", | ||
"mo-tap", | ||
"mo-press", | ||
"mo-swipe" | ||
] | ||
} | ||
} | ||
} |
@@ -1,10 +0,94 @@ | ||
# aurelia-skeleton-plugin | ||
# aurelia-mobile-plugin | ||
[![ZenHub](https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png)](https://zenhub.io) | ||
[![Join the chat at https://gitter.im/aurelia/discuss](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/aurelia/discuss?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
> This is a easy-to-use plugin to support all mobile features in the aurelia framework. | ||
> We used the following technologies. | ||
> [Hammer.js](http://hammerjs.github.io/) - Hammer helps you add support for touch gestures to your page, and remove the 300ms delay from clicks. | ||
> [iScroll.js](http://iscrolljs.com/) - iScroll is a high performance, small footprint, dependency free, multi-platform javascript scroller. | ||
This skeleton is part of the [Aurelia](http://www.aurelia.io/) platform. It sets up a standard aurelia plugin using gulp to build your ES6 code with the Babel compiler. Karma/Jasmine testing is also configured. | ||
## Installation | ||
> To keep up to date on [Aurelia](http://www.aurelia.io/), please visit and subscribe to [the official blog](http://blog.durandal.io/) and [our email list](http://durandal.us10.list-manage1.com/subscribe?u=dae7661a3872ee02b519f6f29&id=3de6801ccc). We also invite you to [follow us on twitter](https://twitter.com/aureliaeffect). If you have questions, please [join our community on Gitter](https://gitter.im/aurelia/discuss). If you would like to have deeper insight into our development process, please install the [ZenHub](https://zenhub.io) Chrome or Firefox Extension and visit any of our repository's boards. You can get an overview of all Aurelia work by visiting [the framework board](https://github.com/aurelia/framework#boards). | ||
``` | ||
npm install aurelia-mobile-plugin --save | ||
``` | ||
To install the plugin and add the plugin in your apps configure function: | ||
``` | ||
aurelia.use | ||
//... | ||
.plugin('aurelia-mobile-plugin') | ||
//... | ||
``` | ||
## Custom Attributes | ||
### mo-tap | ||
In your View | ||
``` | ||
<button mo-tap.call="handleTap($event)"></button> | ||
``` | ||
In your View Model | ||
``` | ||
handleTap($event) { | ||
// here you have $event.hammerEvent holding the original event from HammerJS. | ||
} | ||
``` | ||
### mo-press | ||
In your View | ||
``` | ||
<button mo-press.call="handlePress($event)"></button> | ||
``` | ||
In your View Model | ||
``` | ||
handlePress($event) { | ||
// here you have $event.hammerEvent holding the original event from HammerJS. | ||
} | ||
### mo-slide | ||
In your View | ||
``` | ||
<section mo-slide.call="handleSwipe($event)"></section> | ||
``` | ||
In your View Model | ||
``` | ||
handleSwipe($event) { | ||
if ($event.direction === 'left') { | ||
} else if ($event.direction === 'right') { | ||
} | ||
// here you have $event.hammerEvent holding the original event from HammerJS. | ||
} | ||
``` | ||
### mo-scroll | ||
Add this custom attribute on your wrapper element. The first child of this wrapper element will be the scroll element. | ||
In your View | ||
``` | ||
<div mo-scroll="scrollOptions"> | ||
<ul> | ||
<li>...</li> | ||
<li>...</li> | ||
... | ||
</ul> | ||
</div> | ||
``` | ||
In your View Model | ||
``` | ||
public scrollOptions = { | ||
mouseWheel: true, | ||
click: false, | ||
tap: true, | ||
useTransform: true, | ||
zoom: false, | ||
}; | ||
``` | ||
You find more configurations [here](https://github.com/cubiq/iscroll#configuring-the-iscroll); | ||
## Building The Code | ||
@@ -59,1 +143,4 @@ | ||
``` | ||
## License | ||
[MIT](./LICENSE) |
@@ -1,7 +0,24 @@ | ||
import activateFastclick from 'fast-click'; | ||
// Exports | ||
// export * from 'iscroll'; | ||
export * from './mo-scroll'; | ||
export * from './mo-tap'; | ||
export * from './mo-press'; | ||
export * from './mo-swipe'; | ||
export function configure(config) { | ||
config.globalResources('./hello-world'); | ||
/** | ||
* Imports hammer-time to eliminate the 300ms delay on mobile browsers | ||
*/ | ||
import 'hammer-timejs'; | ||
activateFastclick(); | ||
/** | ||
* Configures the plugin. | ||
*/ | ||
export function configure(aurelia) { | ||
console.warn('Wuiiiiiii configure'); | ||
aurelia.globalResources( | ||
'./mo-scroll', | ||
'./mo-tap', | ||
'./mo-press', | ||
'./mo-swipe' | ||
); | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
79349
51
0
1205
146
4
1
+ Addedaurelia-framework@^1.0.2
+ Addedhammer-timejs@^1.1.0
+ Addedaurelia-binding@2.5.4(transitive)
+ Addedaurelia-dependency-injection@1.6.1(transitive)
+ Addedaurelia-framework@1.4.1(transitive)
+ Addedaurelia-loader@1.0.2(transitive)
+ Addedaurelia-logging@1.5.2(transitive)
+ Addedaurelia-metadata@1.0.8(transitive)
+ Addedaurelia-pal@1.8.2(transitive)
+ Addedaurelia-path@1.1.8(transitive)
+ Addedaurelia-task-queue@1.3.3(transitive)
+ Addedaurelia-templating@1.11.1(transitive)
+ Addedhammer-timejs@1.1.0(transitive)
- Removedfastclick@^1.0.6
- Removedfastclick@1.0.6(transitive)