Commit be2660dc by Tomas Alabes

Updating dependencies including eve

parent e8e89178
...@@ -2,4 +2,5 @@ node_modules ...@@ -2,4 +2,5 @@ node_modules
bower_components/ bower_components/
.idea .idea
*.iml *.iml
\ No newline at end of file npm-debug.log
\ No newline at end of file
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
"main": "raphael.min.js", "main": "raphael.min.js",
"description": "JavaScript Vector Library", "description": "JavaScript Vector Library",
"dependencies": { "dependencies": {
"eve": "https://github.com/adobe-webplatform/eve.git#eef80ed" "eve": "adobe-webplatform/eve"
}, },
"devDependencies": { "devDependencies": {
"requirejs": "~2.1.17" "requirejs": "2.3.2"
}, },
"moduleType": [ "moduleType": [
"amd", "amd",
......
define(["eve"], function(eve) { define(["eve/eve"], function(eve) {
/*\ /*\
* Raphael * Raphael
......
...@@ -13,17 +13,17 @@ ...@@ -13,17 +13,17 @@
} }
], ],
"dependencies": { "dependencies": {
"eve": "git://github.com/adobe-webplatform/eve.git#eef80ed" "eve": "0.5.0"
}, },
"devDependencies": { "devDependencies": {
"bower": "1.4.1", "bower": "1.7.9",
"eslint": "^2.7.0", "eslint": "3.6.1",
"eslint-config-standard": "^5.1.0", "eslint-config-standard": "6.2.0",
"eslint-loader": "^1.3.0", "eslint-loader": "1.5.0",
"eslint-plugin-promise": "^1.1.0", "eslint-plugin-promise": "2.0.1",
"eslint-plugin-standard": "^1.3.2", "eslint-plugin-standard": "2.0.1",
"qunitjs": "1.21.0", "qunitjs": "2.0.1",
"webpack": "^1.12.15" "webpack": "1.13.2"
}, },
"scripts": { "scripts": {
"start": "npm install && bower install", "start": "npm install && bower install",
......
...@@ -5482,29 +5482,17 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -5482,29 +5482,17 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ }, /***/ },
/* 2 */ /* 2 */
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved. /*
// * Eve 0.2.4 - JavaScript Events Library
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * Copyright (c) 2011 Dmitry Baranovskiy (http://dmitry.baranovskiy.com/)
// You may obtain a copy of the License at * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
// */
// 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.
// ┌────────────────────────────────────────────────────────────┐ \\
// │ Eve 0.4.2 - JavaScript Events Library │ \\
// ├────────────────────────────────────────────────────────────┤ \\
// │ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) │ \\
// └────────────────────────────────────────────────────────────┘ \\
(function (glob) { (function (glob) {
var version = "0.4.2", var version = "0.2.4",
has = "hasOwnProperty", has = "hasOwnProperty",
separator = /[\.\/]/, separator = /[\.\/]/,
wildcard = "*", wildcard = "*",
...@@ -5513,26 +5501,27 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -5513,26 +5501,27 @@ return /******/ (function(modules) { // webpackBootstrap
return a - b; return a - b;
}, },
current_event, current_event,
stop,
events = {n: {}}, events = {n: {}},
/*\ /*\
* eve * eve
[ method ] [ method ]
**
* Fires event with given `name`, given scope and other parameters. * Fires event with given `name`, given scope and other parameters.
**
> Arguments > Arguments
**
- name (string) name of the *event*, dot (`.`) or slash (`/`) separated - name (string) name of the event, dot (`.`) or slash (`/`) separated
- scope (object) context for the event handlers - scope (object) context for the event handlers
- varargs (...) the rest of arguments will be sent to event handlers - varargs (...) the rest of arguments will be sent to event handlers
**
= (object) array of returned values from the listeners = (array) array of errors, if any. Each element of the array is in format:
o {
o error (string) error message
o func (function) handler that caused error
o }
\*/ \*/
eve = function (name, scope) { eve = function (name, scope) {
name = String(name);
var e = events, var e = events,
oldstop = stop,
args = Array.prototype.slice.call(arguments, 2), args = Array.prototype.slice.call(arguments, 2),
listeners = eve.listeners(name), listeners = eve.listeners(name),
z = 0, z = 0,
...@@ -5540,11 +5529,8 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -5540,11 +5529,8 @@ return /******/ (function(modules) { // webpackBootstrap
l, l,
indexed = [], indexed = [],
queue = {}, queue = {},
out = [],
ce = current_event,
errors = []; errors = [];
current_event = name; current_event = name;
stop = 0;
for (var i = 0, ii = listeners.length; i < ii; i++) if ("zIndex" in listeners[i]) { for (var i = 0, ii = listeners.length; i < ii; i++) if ("zIndex" in listeners[i]) {
indexed.push(listeners[i].zIndex); indexed.push(listeners[i].zIndex);
if (listeners[i].zIndex < 0) { if (listeners[i].zIndex < 0) {
...@@ -5554,54 +5540,44 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -5554,54 +5540,44 @@ return /******/ (function(modules) { // webpackBootstrap
indexed.sort(numsort); indexed.sort(numsort);
while (indexed[z] < 0) { while (indexed[z] < 0) {
l = queue[indexed[z++]]; l = queue[indexed[z++]];
out.push(l.apply(scope, args)); if (l.apply(scope, args) === f) {
if (stop) { return f;
stop = oldstop;
return out;
} }
} }
for (i = 0; i < ii; i++) { for (i = 0; i < ii; i++) {
l = listeners[i]; l = listeners[i];
if ("zIndex" in l) { if ("zIndex" in l) {
if (l.zIndex == indexed[z]) { if (l.zIndex == indexed[z]) {
out.push(l.apply(scope, args)); if (l.apply(scope, args) === f) {
if (stop) { return f;
break;
} }
do { do {
z++; z++;
l = queue[indexed[z]]; l = queue[indexed[z]];
l && out.push(l.apply(scope, args)); if (l && l.apply(scope, args) === f) {
if (stop) { return f;
break;
} }
} while (l) } while (l)
} else { } else {
queue[l.zIndex] = l; queue[l.zIndex] = l;
} }
} else { } else {
out.push(l.apply(scope, args)); if (l.apply(scope, args) === f) {
if (stop) { return f;
break;
} }
} }
} }
stop = oldstop;
current_event = ce;
return out.length ? out : null;
}; };
// Undocumented. Debug only.
eve._events = events;
/*\ /*\
* eve.listeners * eve.listeners
[ method ] [ method ]
**
* Internal method which gives you array of all event handlers that will be triggered by the given `name`. * Internal method which gives you array of all event handlers that will be triggered by the given `name`.
**
> Arguments > Arguments
**
- name (string) name of the event, dot (`.`) or slash (`/`) separated - name (string) name of the event, dot (`.`) or slash (`/`) separated
**
= (array) array of event handlers = (array) array of event handlers
\*/ \*/
eve.listeners = function (name) { eve.listeners = function (name) {
...@@ -5650,26 +5626,22 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -5650,26 +5626,22 @@ return /******/ (function(modules) { // webpackBootstrap
- name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
- f (function) event handler function - f (function) event handler function
** **
= (function) returned function accepts a single numeric parameter that represents z-index of the handler. It is an optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment. = (function) returned function accept one number parameter that represents z-index of the handler. It is optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment.
> Example: > Example:
| eve.on("mouse", eatIt)(2); | eve.on("mouse", eat)(2);
| eve.on("mouse", scream); | eve.on("mouse", scream);
| eve.on("mouse", catchIt)(1); | eve.on("mouse", catch)(1);
* This will ensure that `catchIt()` function will be called before `eatIt()`. * This will ensure that `catch` function will be called before `eat`.
* * If you want to put you hadler before not indexed handlers specify negative value.
* If you want to put your handler before non-indexed handlers, specify a negative value.
* Note: I assume most of the time you don’t need to worry about z-index, but it’s nice to have this feature “just in case”. * Note: I assume most of the time you don’t need to worry about z-index, but it’s nice to have this feature “just in case”.
\*/ \*/
eve.on = function (name, f) { eve.on = function (name, f) {
name = String(name);
if (typeof f != "function") {
return function () {};
}
var names = name.split(separator), var names = name.split(separator),
e = events; e = events;
for (var i = 0, ii = names.length; i < ii; i++) { for (var i = 0, ii = names.length; i < ii; i++) {
e = e.n; e = e.n;
e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {n: {}}); !e[names[i]] && (e[names[i]] = {n: {}});
e = e[names[i]];
} }
e.f = e.f || []; e.f = e.f || [];
for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) { for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) {
...@@ -5683,37 +5655,6 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -5683,37 +5655,6 @@ return /******/ (function(modules) { // webpackBootstrap
}; };
}; };
/*\ /*\
* eve.f
[ method ]
**
* Returns function that will fire given event with optional arguments.
* Arguments that will be passed to the result function will be also
* concated to the list of final arguments.
| el.onclick = eve.f("click", 1, 2);
| eve.on("click", function (a, b, c) {
| console.log(a, b, c); // 1, 2, [event object]
| });
> Arguments
- event (string) event name
- varargs (…) and any other arguments
= (function) possible event handler function
\*/
eve.f = function (event) {
var attrs = [].slice.call(arguments, 1);
return function () {
eve.apply(null, [event, null].concat(attrs).concat([].slice.call(arguments, 0)));
};
};
/*\
* eve.stop
[ method ]
**
* Is used inside an event handler to stop the event, preventing any subsequent listeners from firing.
\*/
eve.stop = function () {
stop = 1;
};
/*\
* eve.nt * eve.nt
[ method ] [ method ]
** **
...@@ -5734,48 +5675,24 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -5734,48 +5675,24 @@ return /******/ (function(modules) { // webpackBootstrap
return current_event; return current_event;
}; };
/*\ /*\
* eve.nts * eve.unbind
[ method ]
**
* Could be used inside event handler to figure out actual name of the event.
**
**
= (array) names of the event
\*/
eve.nts = function () {
return current_event.split(separator);
};
/*\
* eve.off
[ method ] [ method ]
** **
* Removes given function from the list of event listeners assigned to given name. * Removes given function from the list of event listeners assigned to given name.
* If no arguments specified all the events will be cleared.
** **
> Arguments > Arguments
** **
- name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
- f (function) event handler function - f (function) event handler function
\*/ \*/
/*\ eve.unbind = function (name, f) {
* eve.unbind
[ method ]
**
* See @eve.off
\*/
eve.off = eve.unbind = function (name, f) {
if (!name) {
eve._events = events = {n: {}};
return;
}
var names = name.split(separator), var names = name.split(separator),
e, e,
key, key,
splice, splice,
i, ii, j, jj,
cur = [events]; cur = [events];
for (i = 0, ii = names.length; i < ii; i++) { for (var i = 0, ii = names.length; i < ii; i++) {
for (j = 0; j < cur.length; j += splice.length - 2) { for (var j = 0; j < cur.length; j += splice.length - 2) {
splice = [j, 1]; splice = [j, 1];
e = cur[j].n; e = cur[j].n;
if (names[i] != wildcard) { if (names[i] != wildcard) {
...@@ -5795,16 +5712,16 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -5795,16 +5712,16 @@ return /******/ (function(modules) { // webpackBootstrap
while (e.n) { while (e.n) {
if (f) { if (f) {
if (e.f) { if (e.f) {
for (j = 0, jj = e.f.length; j < jj; j++) if (e.f[j] == f) { for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) {
e.f.splice(j, 1); e.f.splice(i, 1);
break; break;
} }
!e.f.length && delete e.f; !e.f.length && delete e.f;
} }
for (key in e.n) if (e.n[has](key) && e.n[key].f) { for (key in e.n) if (e.n[has](key) && e.n[key].f) {
var funcs = e.n[key].f; var funcs = e.n[key].f;
for (j = 0, jj = funcs.length; j < jj; j++) if (funcs[j] == f) { for (i = 0, ii = funcs.length; i < ii; i++) if (funcs[i] == f) {
funcs.splice(j, 1); funcs.splice(i, 1);
break; break;
} }
!funcs.length && delete e.n[key].f; !funcs.length && delete e.n[key].f;
...@@ -5820,30 +5737,6 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -5820,30 +5737,6 @@ return /******/ (function(modules) { // webpackBootstrap
} }
}; };
/*\ /*\
* eve.once
[ method ]
**
* Binds given event handler with a given name to only run once then unbind itself.
| eve.once("login", f);
| eve("login"); // triggers f
| eve("login"); // no listeners
* Use @eve to trigger the listener.
**
> Arguments
**
- name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
- f (function) event handler function
**
= (function) same return function as @eve.on
\*/
eve.once = function (name, f) {
var f2 = function () {
eve.unbind(name, f2);
return f.apply(this, arguments);
};
return eve.on(name, f2);
};
/*\
* eve.version * eve.version
[ property (string) ] [ property (string) ]
** **
...@@ -5853,10 +5746,9 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -5853,10 +5746,9 @@ return /******/ (function(modules) { // webpackBootstrap
eve.toString = function () { eve.toString = function () {
return "You are running Eve " + version; return "You are running Eve " + version;
}; };
(typeof module != "undefined" && module.exports) ? (module.exports = eve) : ( true ? (!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { return eve; }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))) : (glob.eve = eve)); (typeof module != "undefined" && module.exports) ? (module.exports = eve) : (glob.eve = eve);
})(this); })(this);
/***/ }, /***/ },
/* 3 */ /* 3 */
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -9,14 +9,14 @@ ...@@ -9,14 +9,14 @@
(function webpackUniversalModuleDefinition(root, factory) { (function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object') if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("eve")); module.exports = factory();
else if(typeof define === 'function' && define.amd) else if(typeof define === 'function' && define.amd)
define(["eve"], factory); define([], factory);
else if(typeof exports === 'object') else if(typeof exports === 'object')
exports["Raphael"] = factory(require("eve")); exports["Raphael"] = factory();
else else
root["Raphael"] = factory(root["eve"]); root["Raphael"] = factory();
})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) { })(this, function() {
return /******/ (function(modules) { // webpackBootstrap return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
...@@ -5484,7 +5484,270 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -5484,7 +5484,270 @@ return /******/ (function(modules) { // webpackBootstrap
/* 2 */ /* 2 */
/***/ function(module, exports) { /***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_2__; /*
* Eve 0.2.4 - JavaScript Events Library
*
* Copyright (c) 2011 Dmitry Baranovskiy (http://dmitry.baranovskiy.com/)
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
*/
(function (glob) {
var version = "0.2.4",
has = "hasOwnProperty",
separator = /[\.\/]/,
wildcard = "*",
fun = function () {},
numsort = function (a, b) {
return a - b;
},
current_event,
events = {n: {}},
/*\
* eve
[ method ]
**
* Fires event with given `name`, given scope and other parameters.
**
> Arguments
**
- name (string) name of the event, dot (`.`) or slash (`/`) separated
- scope (object) context for the event handlers
- varargs (...) the rest of arguments will be sent to event handlers
**
= (array) array of errors, if any. Each element of the array is in format:
o {
o error (string) error message
o func (function) handler that caused error
o }
\*/
eve = function (name, scope) {
var e = events,
args = Array.prototype.slice.call(arguments, 2),
listeners = eve.listeners(name),
z = 0,
f = false,
l,
indexed = [],
queue = {},
errors = [];
current_event = name;
for (var i = 0, ii = listeners.length; i < ii; i++) if ("zIndex" in listeners[i]) {
indexed.push(listeners[i].zIndex);
if (listeners[i].zIndex < 0) {
queue[listeners[i].zIndex] = listeners[i];
}
}
indexed.sort(numsort);
while (indexed[z] < 0) {
l = queue[indexed[z++]];
if (l.apply(scope, args) === f) {
return f;
}
}
for (i = 0; i < ii; i++) {
l = listeners[i];
if ("zIndex" in l) {
if (l.zIndex == indexed[z]) {
if (l.apply(scope, args) === f) {
return f;
}
do {
z++;
l = queue[indexed[z]];
if (l && l.apply(scope, args) === f) {
return f;
}
} while (l)
} else {
queue[l.zIndex] = l;
}
} else {
if (l.apply(scope, args) === f) {
return f;
}
}
}
};
/*\
* eve.listeners
[ method ]
**
* Internal method which gives you array of all event handlers that will be triggered by the given `name`.
**
> Arguments
**
- name (string) name of the event, dot (`.`) or slash (`/`) separated
**
= (array) array of event handlers
\*/
eve.listeners = function (name) {
var names = name.split(separator),
e = events,
item,
items,
k,
i,
ii,
j,
jj,
nes,
es = [e],
out = [];
for (i = 0, ii = names.length; i < ii; i++) {
nes = [];
for (j = 0, jj = es.length; j < jj; j++) {
e = es[j].n;
items = [e[names[i]], e[wildcard]];
k = 2;
while (k--) {
item = items[k];
if (item) {
nes.push(item);
out = out.concat(item.f || []);
}
}
}
es = nes;
}
return out;
};
/*\
* eve.on
[ method ]
**
* Binds given event handler with a given name. You can use wildcards “`*`” for the names:
| eve.on("*.under.*", f);
| eve("mouse.under.floor"); // triggers f
* Use @eve to trigger the listener.
**
> Arguments
**
- name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
- f (function) event handler function
**
= (function) returned function accept one number parameter that represents z-index of the handler. It is optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment.
> Example:
| eve.on("mouse", eat)(2);
| eve.on("mouse", scream);
| eve.on("mouse", catch)(1);
* This will ensure that `catch` function will be called before `eat`.
* If you want to put you hadler before not indexed handlers specify negative value.
* Note: I assume most of the time you don’t need to worry about z-index, but it’s nice to have this feature “just in case”.
\*/
eve.on = function (name, f) {
var names = name.split(separator),
e = events;
for (var i = 0, ii = names.length; i < ii; i++) {
e = e.n;
!e[names[i]] && (e[names[i]] = {n: {}});
e = e[names[i]];
}
e.f = e.f || [];
for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) {
return fun;
}
e.f.push(f);
return function (zIndex) {
if (+zIndex == +zIndex) {
f.zIndex = +zIndex;
}
};
};
/*\
* eve.nt
[ method ]
**
* Could be used inside event handler to figure out actual name of the event.
**
> Arguments
**
- subname (string) #optional subname of the event
**
= (string) name of the event, if `subname` is not specified
* or
= (boolean) `true`, if current event’s name contains `subname`
\*/
eve.nt = function (subname) {
if (subname) {
return new RegExp("(?:\\.|\\/|^)" + subname + "(?:\\.|\\/|$)").test(current_event);
}
return current_event;
};
/*\
* eve.unbind
[ method ]
**
* Removes given function from the list of event listeners assigned to given name.
**
> Arguments
**
- name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
- f (function) event handler function
\*/
eve.unbind = function (name, f) {
var names = name.split(separator),
e,
key,
splice,
cur = [events];
for (var i = 0, ii = names.length; i < ii; i++) {
for (var j = 0; j < cur.length; j += splice.length - 2) {
splice = [j, 1];
e = cur[j].n;
if (names[i] != wildcard) {
if (e[names[i]]) {
splice.push(e[names[i]]);
}
} else {
for (key in e) if (e[has](key)) {
splice.push(e[key]);
}
}
cur.splice.apply(cur, splice);
}
}
for (i = 0, ii = cur.length; i < ii; i++) {
e = cur[i];
while (e.n) {
if (f) {
if (e.f) {
for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) {
e.f.splice(i, 1);
break;
}
!e.f.length && delete e.f;
}
for (key in e.n) if (e.n[has](key) && e.n[key].f) {
var funcs = e.n[key].f;
for (i = 0, ii = funcs.length; i < ii; i++) if (funcs[i] == f) {
funcs.splice(i, 1);
break;
}
!funcs.length && delete e.n[key].f;
}
} else {
delete e.f;
for (key in e.n) if (e.n[has](key) && e.n[key].f) {
delete e.n[key].f;
}
}
e = e.n;
}
}
};
/*\
* eve.version
[ property (string) ]
**
* Current version of the library.
\*/
eve.version = version;
eve.toString = function () {
return "You are running Eve " + version;
};
(typeof module != "undefined" && module.exports) ? (module.exports = eve) : (glob.eve = eve);
})(this);
/***/ }, /***/ },
/* 3 */ /* 3 */
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment