Skip to content

Commit

Permalink
Merge branch 'master' of github.com:enyojs/enyo
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Miles committed Mar 23, 2012
2 parents 2872780 + 7ccf2f1 commit e2535e6
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 19 deletions.
2 changes: 1 addition & 1 deletion enyo.js
Expand Up @@ -11,7 +11,7 @@
src = s.getAttribute("src") || "";
if (src.slice(-l) == inName) {
s.located = true;
return {path: src.slice(0, src.lastIndexOf("/")), node: s};
return {path: src.slice(0, Math.max(0, src.lastIndexOf("/"))), node: s};
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/boot/enyo.js
Expand Up @@ -11,7 +11,7 @@
src = s.getAttribute("src") || "";
if (src.slice(-l) == inName) {
s.located = true;
return {path: src.slice(0, src.lastIndexOf("/")), node: s};
return {path: src.slice(0, Math.max(0, src.lastIndexOf("/"))), node: s};
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions source/boot/loader.js
Expand Up @@ -165,7 +165,7 @@
this.loadScript(inPath);
},
decodePackagePath: function(inPath) {
// A package path can encoded in two ways:
// A package path can be encoded in two ways:
//
// 1. [folder]
// 2. [folder]/[*package.js]
Expand All @@ -176,9 +176,9 @@
// convert back slashes to forward slashes, remove double slashes, split on slash
var parts = inPath.replace(/\\/g, "/").replace(/\/\//g, "/").replace(/:\//, "://").split("/");
if (parts.length) {
// in inPath has a trailing slash, parts has an empty string which we pop off and ignore
// if inPath has a trailing slash, parts has an empty string which we pop off and ignore
var name = parts.pop() || parts.pop() || "";
// test is name includes the manifest tag
// test if name includes the manifest tag
if (name.slice(-manifest.length) !== manifest) {
// if not a manifest name, it's part of the folder path
parts.push(name);
Expand Down
4 changes: 2 additions & 2 deletions source/dom/Control.js
Expand Up @@ -267,7 +267,7 @@ enyo.kind({
// applied by layouts or other objects.
// We may need a 'runtimeStyles' concept separate from a 'userStyles' concept, although
// it's not clear what API calls like 'applyStyle' would affect, and which concept would take
// precendence when there is a conflict.
// precedence when there is a conflict.
// Perhaps we can separate 'style' completely from 'domStyles'. API methods like applyStyle
// would affect domStyles, and the two style databases would be combined at render-time.
// Alternatively, we can disallow changing "style" string at runtime and allow it to be set
Expand Down Expand Up @@ -723,7 +723,7 @@ enyo.Control.subclass = function(ctor, props) {
//
// However, the properties are no longer 'live' in prototypes
// because of this magic. I.e. changes to the prototype of
// a Control subclass will not necesssarily be reflected in
// a Control subclass will not necessarily be reflected in
// instances of that Control (e.g. chained prototypes).
//
// These properties are also renamed to kind* to allow
Expand Down
2 changes: 1 addition & 1 deletion source/dom/dispatcher.js
Expand Up @@ -4,7 +4,7 @@ enyo.$ = {};
enyo.dispatcher = {
// these events come from document
events: ["mousedown", "mouseup", "mouseover", "mouseout", "mousemove", "mousewheel", "click", "dblclick", "change", "keydown", "keyup", "keypress", "input"],
// thes events come from window
// these events come from window
windowEvents: ["resize", "load", "unload", "message"],
// feature plugins (aka filters)
features: [],
Expand Down
7 changes: 5 additions & 2 deletions source/dom/dom.css
@@ -1,11 +1,14 @@
/* things we always want */
body {
-webkit-overflow-scrolling: touch;
}

/* for apps */
.enyo-document-fit {
margin: 0;
height: 100%;
/*overflow: auto;*/
overflow: hidden;
position: relative;
-webkit-overflow-scrolling: touch;
}

/* reset */
Expand Down
3 changes: 2 additions & 1 deletion source/dom/drag.js
Expand Up @@ -20,7 +20,7 @@
//* @protected
enyo.dispatcher.features.push(
function(e) {
// NOTE: beware of properties in enyo.gesture inadvertantly mapped to event types
// NOTE: beware of properties in enyo.gesture inadvertently mapped to event types
if (enyo.gesture.drag[e.type]) {
return enyo.gesture.drag[e.type](e);
}
Expand Down Expand Up @@ -61,6 +61,7 @@ enyo.gesture.drag = {
this.sendDrag(e);
} else if (this.dy*this.dy + this.dx*this.dx >= this.hysteresisSquared) {
this.sendDragStart(e);
e.requireTouchmove = this.dragEvent.requireTouchmove;
this.cancelHold();
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/dom/gesture.js
Expand Up @@ -116,7 +116,7 @@ enyo.gesture.preventNativeDefault = function() {

enyo.dispatcher.features.push(
function(e) {
// NOTE: beware of properties in enyo.gesture inadvertantly mapped to event types
// NOTE: beware of properties in enyo.gesture inadvertently mapped to event types
if (enyo.gesture.events[e.type]) {
return enyo.gesture.events[e.type](e);
}
Expand Down
12 changes: 10 additions & 2 deletions source/dom/platform.js
Expand Up @@ -28,6 +28,9 @@ enyo.platform = {};
var platforms = [
// Android 2 - 4
{platform: "android", regex: /Android (\d+)/},
// Kindle Fire
// Force version to 2, (desktop mode does not list android version)
{platform: "android", regex: /Silk\//, forceVersion: 2},
// IE 8 - 10
{platform: "ie", regex: /MSIE (\d+)/},
// iOS 3 - 5
Expand All @@ -36,10 +39,15 @@ enyo.platform = {};
// webOS 1 - 3
{platform: "webos", regex: /(?:web|hpw)OS\/(\d+)/}
];
for (var i = 0, p, m; p = platforms[i]; i++) {
for (var i = 0, p, m, v; p = platforms[i]; i++) {
m = p.regex.exec(ua);
if (m) {
ep[p.platform] = Number(m[1]);
if (p.forceVersion) {
v = p.forceVersion;
} else {
v = Number(m[1]);
}
ep[p.platform] = v;
break;
}
}
Expand Down
4 changes: 3 additions & 1 deletion source/kernel/UiComponent.js
Expand Up @@ -189,6 +189,7 @@ enyo.kind({
// syntactic sugar for 'waterfall("onresize")'
resized: function() {
this.waterfall("onresize");
this.waterfall("onpostresize");
},
//* @protected
resizeHandler: function() {
Expand Down Expand Up @@ -223,7 +224,7 @@ enyo.createFromKind = function(inKind, inParam) {
// Default owner for ownerless UiComponents to allow notifying such UiComponents of important system events
// like window resize.
//
// NOTE: ownerless UiComponents will not GC unless explicity destroyed as they will be referenced by enyo.master.
// NOTE: ownerless UiComponents will not GC unless explicitly destroyed as they will be referenced by enyo.master.
//
enyo.master = new enyo.Component({
name: "master",
Expand All @@ -239,6 +240,7 @@ enyo.master = new enyo.Component({
// this works because master is a Component, so it' waterfalls
// to it's owned Components (i.e. master has no children)
enyo.master.waterfallDown("onresize");
enyo.master.waterfallDown("onpostresize");
} else {
// all other top level events are sent only to interested Signal receivers
enyo.Signals.send(inEventName, inEvent);
Expand Down
2 changes: 1 addition & 1 deletion source/touch/ScrollMath.js
Expand Up @@ -26,7 +26,7 @@ enyo.kind({
kSnapFriction: 0.9,
//* Scalar applied to 'flick' event velocity
kFlickScalar: 10,
//* the value used in friction() to determine if the deta (e.g. y - y0) is close enough to zero to consider as zero.
//* the value used in friction() to determine if the delta (e.g. y - y0) is close enough to zero to consider as zero.
kFrictionEpsilon: 1e-2,
//* top snap boundary, generally 0
topBoundary: 0,
Expand Down
2 changes: 1 addition & 1 deletion source/touch/ScrollStrategy.js
Expand Up @@ -119,7 +119,7 @@ enyo.kind({
},
// NOTE: mobile native scrollers need touchmove. Indicate this by
// setting the requireTouchmove property to true (must do this in move event
// becuase must respond to first move or native action fails).
// because must respond to first move or native action fails).
move: function(inSender, inEvent) {
var dy = inEvent.pageY - this.downY;
var dx = inEvent.pageX - this.downX;
Expand Down
4 changes: 2 additions & 2 deletions source/touch/touch.js
Expand Up @@ -13,7 +13,7 @@ enyo.requiresWindow(function() {
this.excludedTarget = null;
var e = this.makeEvent(inEvent);
gesture.down(e);
// generate a new event obect since over is a different event
// generate a new event object since over is a different event
e = this.makeEvent(inEvent);
this.overEvent = e;
gesture.over(e);
Expand Down Expand Up @@ -98,7 +98,7 @@ enyo.requiresWindow(function() {
enyo.forEach(['ontouchstart', 'ontouchmove', 'ontouchend', 'ongesturestart', 'ongesturechange', 'ongestureend'], function(e) {
document[e] = enyo.dispatch;
});
// use proper target finding technqiue based on feature detection.
// use proper target finding technique based on feature detection.
if (!document.elementFromPoint) {
this.findTarget = function(inX, inY) {
return this.findTargetTraverse(null, inX, inY);
Expand Down
4 changes: 4 additions & 0 deletions tools/minifier/minify.js
Expand Up @@ -132,6 +132,10 @@ finish = function(loader) {
//w('');
//
var output = opt.output || "build";
var outfolder = path.dirname(output);
if (outfolder != ".") {
fs.mkdirSync(outfolder);
}
//
var css = concatCss(loader);
if (css.length) {
Expand Down

0 comments on commit e2535e6

Please sign in to comment.