Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
todomvc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eugene Shen
todomvc
Commits
a5d0ac74
Commit
a5d0ac74
authored
May 22, 2014
by
Pascal Hartig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flight: Update dependencies
parent
2e2ee2b3
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
295 additions
and
189 deletions
+295
-189
dependency-examples/flight/bower_components/flight/lib/base.js
...dency-examples/flight/bower_components/flight/lib/base.js
+26
-8
dependency-examples/flight/bower_components/flight/lib/component.js
...-examples/flight/bower_components/flight/lib/component.js
+32
-16
dependency-examples/flight/bower_components/flight/lib/compose.js
...cy-examples/flight/bower_components/flight/lib/compose.js
+5
-5
dependency-examples/flight/bower_components/flight/lib/debug.js
...ency-examples/flight/bower_components/flight/lib/debug.js
+31
-23
dependency-examples/flight/bower_components/flight/lib/logger.js
...ncy-examples/flight/bower_components/flight/lib/logger.js
+42
-30
dependency-examples/flight/bower_components/flight/lib/registry.js
...y-examples/flight/bower_components/flight/lib/registry.js
+6
-0
dependency-examples/flight/bower_components/flight/lib/utils.js
...ency-examples/flight/bower_components/flight/lib/utils.js
+29
-1
dependency-examples/flight/bower_components/jquery/jquery.js
dependency-examples/flight/bower_components/jquery/jquery.js
+0
-0
dependency-examples/flight/bower_components/requirejs-text/text.js
...y-examples/flight/bower_components/requirejs-text/text.js
+12
-8
dependency-examples/flight/bower_components/requirejs/require.js
...ncy-examples/flight/bower_components/requirejs/require.js
+112
-98
No files found.
dependency-examples/flight/bower_components/flight/lib/base.js
View file @
a5d0ac74
...
...
@@ -41,6 +41,12 @@ define(
}
}
function
proxyEventTo
(
targetEvent
)
{
return
function
(
e
,
data
)
{
$
(
e
.
target
).
trigger
(
targetEvent
,
data
);
};
}
function
withBase
()
{
// delegate trigger, bind and unbind to an element
...
...
@@ -99,6 +105,8 @@ define(
originalCb
=
utils
.
delegate
(
this
.
resolveDelegateRules
(
origin
)
);
}
else
if
(
typeof
origin
==
'
string
'
)
{
originalCb
=
proxyEventTo
(
origin
);
}
else
{
originalCb
=
origin
;
}
...
...
@@ -117,16 +125,13 @@ define(
callback
=
originalCb
.
bind
(
this
);
callback
.
target
=
originalCb
;
// if the original callback is already branded by jQuery's guid, copy it to the context-bound version
if
(
originalCb
.
guid
)
{
callback
.
guid
=
originalCb
.
guid
;
}
callback
.
context
=
this
;
$element
.
on
(
type
,
callback
);
// get jquery's guid from our bound fn, so unbinding will work
originalCb
.
guid
=
callback
.
guid
;
// store every bound version of the callback
originalCb
.
bound
||
(
originalCb
.
bound
=
[]);
originalCb
.
bound
.
push
(
callback
);
return
callback
;
};
...
...
@@ -148,6 +153,19 @@ define(
type
=
arguments
[
0
];
}
if
(
callback
)
{
//this callback may be the original function or a bound version
var
boundFunctions
=
callback
.
target
?
callback
.
target
.
bound
:
callback
.
bound
||
[];
//set callback to version bound against this instance
boundFunctions
&&
boundFunctions
.
some
(
function
(
fn
,
i
,
arr
)
{
if
(
fn
.
context
&&
(
this
.
identity
==
fn
.
context
.
identity
))
{
arr
.
splice
(
i
,
1
);
callback
=
fn
;
return
true
;
}
},
this
);
}
return
$element
.
off
(
type
,
callback
);
};
...
...
@@ -158,7 +176,7 @@ define(
if
(
!
(
r
in
this
.
attr
))
{
throw
new
Error
(
'
Component "
'
+
this
.
toString
()
+
'
" wants to listen on "
'
+
r
+
'
" but no such attribute was defined.
'
);
}
rules
[
this
.
attr
[
r
]]
=
ruleInfo
[
r
];
rules
[
this
.
attr
[
r
]]
=
(
typeof
ruleInfo
[
r
]
==
'
string
'
)
?
proxyEventTo
(
ruleInfo
[
r
])
:
ruleInfo
[
r
];
},
this
);
return
rules
;
...
...
dependency-examples/flight/bower_components/flight/lib/component.js
View file @
a5d0ac74
...
...
@@ -27,7 +27,11 @@ define(
componentInfo
&&
Object
.
keys
(
componentInfo
.
instances
).
forEach
(
function
(
k
)
{
var
info
=
componentInfo
.
instances
[
k
];
info
.
instance
.
teardown
();
// It's possible that a previous teardown caused another component to teardown,
// so we can't assume that the instances object is as it was.
if
(
info
&&
info
.
instance
)
{
info
.
instance
.
teardown
();
}
});
}
...
...
@@ -65,37 +69,49 @@ define(
}.
bind
(
this
));
}
function
prettyPrintMixins
()
{
//could be called from constructor or constructor.prototype
var
mixedIn
=
this
.
mixedIn
||
this
.
prototype
.
mixedIn
||
[];
return
mixedIn
.
map
(
function
(
mixin
)
{
if
(
mixin
.
name
==
null
)
{
// function name property not supported by this browser, use regex
var
m
=
mixin
.
toString
().
match
(
functionNameRegEx
);
return
(
m
&&
m
[
1
])
?
m
[
1
]
:
''
;
}
else
{
return
(
mixin
.
name
!=
'
withBase
'
)
?
mixin
.
name
:
''
;
}
}).
filter
(
Boolean
).
join
(
'
,
'
);
};
// define the constructor for a custom component type
// takes an unlimited number of mixin functions as arguments
// typical api call with 3 mixins: define(timeline, withTweetCapability, withScrollCapability);
function
define
(
/*mixins*/
)
{
// unpacking arguments by hand benchmarked faster
var
l
=
arguments
.
length
;
// add three for common mixins
var
mixins
=
new
Array
(
l
+
3
);
var
mixins
=
new
Array
(
l
);
for
(
var
i
=
0
;
i
<
l
;
i
++
)
mixins
[
i
]
=
arguments
[
i
];
var
Component
=
function
()
{};
Component
.
toString
=
Component
.
prototype
.
toString
=
function
()
{
var
prettyPrintMixins
=
mixins
.
map
(
function
(
mixin
)
{
if
(
mixin
.
name
==
null
)
{
// function name property not supported by this browser, use regex
var
m
=
mixin
.
toString
().
match
(
functionNameRegEx
);
return
(
m
&&
m
[
1
])
?
m
[
1
]
:
''
;
}
else
{
return
(
mixin
.
name
!=
'
withBase
'
)
?
mixin
.
name
:
''
;
}
}).
filter
(
Boolean
).
join
(
'
,
'
);
return
prettyPrintMixins
;
};
Component
.
toString
=
Component
.
prototype
.
toString
=
prettyPrintMixins
;
if
(
debug
.
enabled
)
{
Component
.
describe
=
Component
.
prototype
.
describe
=
Component
.
toString
();
}
// 'options' is optional hash to be merged with 'defaults' in the component definition
Component
.
attachTo
=
attachTo
;
// enables extension of existing "base" Components
Component
.
mixin
=
function
()
{
var
newComponent
=
define
();
//TODO: fix pretty print
var
newPrototype
=
Object
.
create
(
Component
.
prototype
);
newPrototype
.
mixedIn
=
[].
concat
(
Component
.
prototype
.
mixedIn
);
compose
.
mixin
(
newPrototype
,
arguments
);
newComponent
.
prototype
=
newPrototype
;
newComponent
.
prototype
.
constructor
=
newComponent
;
return
newComponent
;
};
Component
.
teardownAll
=
teardownAll
;
// prepend common mixins to supplied list, then mixin all flavors
...
...
dependency-examples/flight/bower_components/flight/lib/compose.js
View file @
a5d0ac74
...
...
@@ -65,13 +65,13 @@ define(
function
mixin
(
base
,
mixins
)
{
base
.
mixedIn
=
base
.
hasOwnProperty
(
'
mixedIn
'
)
?
base
.
mixedIn
:
[];
mixins
.
forEach
(
function
(
mixin
)
{
if
(
base
.
mixedIn
.
indexOf
(
mixin
)
==
-
1
)
{
for
(
var
i
=
0
;
i
<
mixins
.
length
;
i
++
)
{
if
(
base
.
mixedIn
.
indexOf
(
mixin
s
[
i
]
)
==
-
1
)
{
setPropertyWritability
(
base
,
false
);
mixin
.
call
(
base
);
base
.
mixedIn
.
push
(
mixin
);
mixin
s
[
i
]
.
call
(
base
);
base
.
mixedIn
.
push
(
mixin
s
[
i
]
);
}
}
);
}
setPropertyWritability
(
base
,
true
);
}
...
...
dependency-examples/flight/bower_components/flight/lib/debug.js
View file @
a5d0ac74
...
...
@@ -11,9 +11,9 @@ define(
function
()
{
'
use strict
'
;
//
******************************************************************************************
//
==========================================
// Search object model
//
******************************************************************************************
//
==========================================
function
traverse
(
util
,
searchTerm
,
options
)
{
options
=
options
||
{};
...
...
@@ -53,17 +53,17 @@ define(
function
byValueCoerced
(
searchTerm
,
options
)
{
search
(
'
valueCoerced
'
,
null
,
searchTerm
,
options
);}
function
custom
(
fn
,
options
)
{
traverse
(
fn
,
null
,
options
);}
//
******************************************************************************************
//
==========================================
// Event logging
//
******************************************************************************************
//
==========================================
var
ALL
=
'
all
'
;
//no filter
//
no logg
ing by default
var
defaultEventNamesFilter
=
[];
var
defaultActionsFilter
=
[];
var
logFilter
=
retrieveLogFilter
();
//
log noth
ing by default
var
logFilter
=
{
eventNames
:
[],
actions
:
[]
}
function
filterEventLogsByAction
(
/*actions*/
)
{
var
actions
=
[].
slice
.
call
(
arguments
);
...
...
@@ -94,26 +94,32 @@ define(
}
function
saveLogFilter
()
{
if
(
window
.
localStorage
)
{
localStorage
.
setItem
(
'
logFilter_eventNames
'
,
logFilter
.
eventNames
);
localStorage
.
setItem
(
'
logFilter_actions
'
,
logFilter
.
actions
);
}
try
{
if
(
window
.
localStorage
)
{
localStorage
.
setItem
(
'
logFilter_eventNames
'
,
logFilter
.
eventNames
);
localStorage
.
setItem
(
'
logFilter_actions
'
,
logFilter
.
actions
);
}
}
catch
(
ignored
)
{};
}
function
retrieveLogFilter
()
{
var
result
=
{
eventNames
:
(
window
.
localStorage
&&
localStorage
.
getItem
(
'
logFilter_eventNames
'
))
||
defaultEventNamesFilter
,
actions
:
(
window
.
localStorage
&&
localStorage
.
getItem
(
'
logFilter_actions
'
))
||
defaultActionsFilter
};
// reconstitute arrays
Object
.
keys
(
result
).
forEach
(
function
(
k
)
{
var
thisProp
=
result
[
k
];
var
eventNames
,
actions
;
try
{
eventNames
=
(
window
.
localStorage
&&
localStorage
.
getItem
(
'
logFilter_eventNames
'
));
actions
=
(
window
.
localStorage
&&
localStorage
.
getItem
(
'
logFilter_actions
'
));
}
catch
(
ignored
)
{
return
;
}
eventNames
&&
(
logFilter
.
eventNames
=
eventNames
);
actions
&&
(
logFilter
.
actions
=
actions
);
// reconstitute arrays in place
Object
.
keys
(
logFilter
).
forEach
(
function
(
k
)
{
var
thisProp
=
logFilter
[
k
];
if
(
typeof
thisProp
==
'
string
'
&&
thisProp
!==
ALL
)
{
result
[
k
]
=
thisProp
.
split
(
'
,
'
)
;
logFilter
[
k
]
=
thisProp
?
thisProp
.
split
(
'
,
'
)
:
[]
;
}
});
return
result
;
}
return
{
...
...
@@ -126,6 +132,8 @@ define(
console
.
info
(
'
You can configure event logging with DEBUG.events.logAll()/logNone()/logByName()/logByAction()
'
);
}
retrieveLogFilter
();
window
.
DEBUG
=
this
;
},
...
...
dependency-examples/flight/bower_components/flight/lib/logger.js
View file @
a5d0ac74
...
...
@@ -27,47 +27,54 @@ define(
}
function
log
(
action
,
component
,
eventArgs
)
{
var
name
,
elem
,
fn
,
logFilter
,
toRegExp
,
actionLoggable
,
nameLoggable
;
if
(
!
window
.
DEBUG
||
!
window
.
DEBUG
.
enabled
)
return
;
var
name
,
eventType
,
elem
,
fn
,
payload
,
logFilter
,
toRegExp
,
actionLoggable
,
nameLoggable
,
info
;
if
(
typeof
eventArgs
[
eventArgs
.
length
-
1
]
==
'
function
'
)
{
fn
=
eventArgs
.
pop
();
fn
=
fn
.
unbound
||
fn
;
// use unbound version if any (better info)
}
if
(
typeof
eventArgs
[
eventArgs
.
length
-
1
]
==
'
object
'
)
{
eventArgs
.
pop
();
// trigger data arg - not logged right now
}
if
(
eventArgs
.
length
==
2
)
{
elem
=
eventArgs
[
0
];
name
=
eventArgs
[
1
];
}
else
{
if
(
eventArgs
.
length
==
1
)
{
elem
=
component
.
$node
[
0
];
eventType
=
eventArgs
[
0
];
}
else
if
((
eventArgs
.
length
==
2
)
&&
typeof
eventArgs
[
1
]
==
'
object
'
&&
!
eventArgs
[
1
].
type
)
{
//2 args, first arg is not elem
elem
=
component
.
$node
[
0
];
name
=
eventArgs
[
0
];
eventType
=
eventArgs
[
0
];
if
(
action
==
"
trigger
"
)
{
payload
=
eventArgs
[
1
];
}
}
else
{
//2+ args, first arg is elem
elem
=
eventArgs
[
0
];
eventType
=
eventArgs
[
1
];
if
(
action
==
"
trigger
"
)
{
payload
=
eventArgs
[
2
];
}
}
if
(
window
.
DEBUG
&&
window
.
DEBUG
.
enabled
)
{
logFilter
=
DEBUG
.
events
.
logFilter
;
name
=
typeof
eventType
==
'
object
'
?
eventType
.
type
:
eventType
;
// no regex for you, actions...
actionLoggable
=
logFilter
.
actions
==
'
all
'
||
(
logFilter
.
actions
.
indexOf
(
action
)
>
-
1
);
// event name filter allow wildcards or regex...
toRegExp
=
function
(
expr
)
{
return
expr
.
test
?
expr
:
new
RegExp
(
'
^
'
+
expr
.
replace
(
/
\*
/g
,
'
.*
'
)
+
'
$
'
);
};
nameLoggable
=
logFilter
.
eventNames
==
'
all
'
||
logFilter
.
eventNames
.
some
(
function
(
e
)
{
return
toRegExp
(
e
).
test
(
name
);});
logFilter
=
DEBUG
.
events
.
logFilter
;
if
(
actionLoggable
&&
nameLoggable
)
{
console
.
info
(
actionSymbols
[
action
],
action
,
'
[
'
+
name
+
'
]
'
,
elemToString
(
elem
),
component
.
constructor
.
describe
.
split
(
'
'
).
slice
(
0
,
3
).
join
(
'
'
)
// two mixins only
);
}
// no regex for you, actions...
actionLoggable
=
logFilter
.
actions
==
'
all
'
||
(
logFilter
.
actions
.
indexOf
(
action
)
>
-
1
);
// event name filter allow wildcards or regex...
toRegExp
=
function
(
expr
)
{
return
expr
.
test
?
expr
:
new
RegExp
(
'
^
'
+
expr
.
replace
(
/
\*
/g
,
'
.*
'
)
+
'
$
'
);
};
nameLoggable
=
logFilter
.
eventNames
==
'
all
'
||
logFilter
.
eventNames
.
some
(
function
(
e
)
{
return
toRegExp
(
e
).
test
(
name
);});
if
(
actionLoggable
&&
nameLoggable
)
{
info
=
[
actionSymbols
[
action
],
action
,
'
[
'
+
name
+
'
]
'
];
payload
&&
info
.
push
(
payload
);
info
.
push
(
elemToString
(
elem
));
info
.
push
(
component
.
constructor
.
describe
.
split
(
'
'
).
slice
(
0
,
3
).
join
(
'
'
));
console
.
groupCollapsed
&&
action
==
'
trigger
'
&&
console
.
groupCollapsed
(
action
,
name
);
console
.
info
.
apply
(
console
,
info
);
}
}
...
...
@@ -75,6 +82,11 @@ define(
this
.
before
(
'
trigger
'
,
function
()
{
log
(
'
trigger
'
,
this
,
utils
.
toArray
(
arguments
));
});
if
(
console
.
groupCollapsed
)
{
this
.
after
(
'
trigger
'
,
function
()
{
console
.
groupEnd
();
});
}
this
.
before
(
'
on
'
,
function
()
{
log
(
'
on
'
,
this
,
utils
.
toArray
(
arguments
));
});
...
...
dependency-examples/flight/bower_components/flight/lib/registry.js
View file @
a5d0ac74
...
...
@@ -151,6 +151,12 @@ define(
return
this
.
allInstances
[
instance
.
identity
]
||
null
;
};
this
.
getBoundEventNames
=
function
(
instance
)
{
return
this
.
findInstanceInfo
(
instance
).
events
.
map
(
function
(
ev
)
{
return
ev
.
type
;
});
};
this
.
findInstanceInfoByNode
=
function
(
node
)
{
var
result
=
[];
Object
.
keys
(
this
.
allInstances
).
forEach
(
function
(
k
)
{
...
...
dependency-examples/flight/bower_components/flight/lib/utils.js
View file @
a5d0ac74
...
...
@@ -219,13 +219,41 @@ define(
var
target
=
$
(
e
.
target
),
parent
;
Object
.
keys
(
rules
).
forEach
(
function
(
selector
)
{
if
((
parent
=
target
.
closest
(
selector
)).
length
)
{
if
(
!
e
.
isPropagationStopped
()
&&
(
parent
=
target
.
closest
(
selector
)).
length
)
{
data
=
data
||
{};
data
.
el
=
parent
[
0
];
return
rules
[
selector
].
apply
(
this
,
[
e
,
data
]);
}
},
this
);
};
},
// ensures that a function will only be called once.
// usage:
// will only create the application once
// var initialize = utils.once(createApplication)
// initialize();
// initialize();
//
// will only delete a record once
// var myHanlder = function () {
// $.ajax({type: 'DELETE', url: 'someurl.com', data: {id: 1}});
// };
// this.on('click', utils.once(myHandler));
//
once
:
function
(
func
)
{
var
ran
,
result
;
return
function
()
{
if
(
ran
)
{
return
result
;
}
ran
=
true
;
result
=
func
.
apply
(
this
,
arguments
);
return
result
;
};
}
};
...
...
dependency-examples/flight/bower_components/jquery/jquery.js
100644 → 100755
View file @
a5d0ac74
File mode changed from 100644 to 100755
dependency-examples/flight/bower_components/requirejs-text/text.js
View file @
a5d0ac74
/**
* @license RequireJS text 2.0.1
0 Copyright (c) 2010-2012
, The Dojo Foundation All Rights Reserved.
* @license RequireJS text 2.0.1
2 Copyright (c) 2010-2014
, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/requirejs/text for details
*/
...
...
@@ -23,7 +23,7 @@ define(['module'], function (module) {
masterConfig
=
(
module
.
config
&&
module
.
config
())
||
{};
text
=
{
version
:
'
2.0.1
0
'
,
version
:
'
2.0.1
2
'
,
strip
:
function
(
content
)
{
//Strips <?xml ...?> declarations so that external SVG and XML
...
...
@@ -162,12 +162,12 @@ define(['module'], function (module) {
// Do not bother with the work if a build and text will
// not be inlined.
if
(
config
.
isBuild
&&
!
config
.
inlineText
)
{
if
(
config
&&
config
.
isBuild
&&
!
config
.
inlineText
)
{
onLoad
();
return
;
}
masterConfig
.
isBuild
=
config
.
isBuild
;
masterConfig
.
isBuild
=
config
&&
config
.
isBuild
;
var
parsed
=
text
.
parseName
(
name
),
nonStripName
=
parsed
.
moduleName
+
...
...
@@ -257,7 +257,9 @@ define(['module'], function (module) {
}
callback
(
file
);
}
catch
(
e
)
{
errback
(
e
);
if
(
errback
)
{
errback
(
e
);
}
}
};
}
else
if
(
masterConfig
.
env
===
'
xhr
'
||
(
!
masterConfig
.
env
&&
...
...
@@ -285,12 +287,14 @@ define(['module'], function (module) {
//Do not explicitly handle errors, those should be
//visible via console output in the browser.
if
(
xhr
.
readyState
===
4
)
{
status
=
xhr
.
status
;
status
=
xhr
.
status
||
0
;
if
(
status
>
399
&&
status
<
600
)
{
//An http 4xx or 5xx error. Signal an error.
err
=
new
Error
(
url
+
'
HTTP status:
'
+
status
);
err
.
xhr
=
xhr
;
errback
(
err
);
if
(
errback
)
{
errback
(
err
);
}
}
else
{
callback
(
xhr
.
responseText
);
}
...
...
@@ -347,7 +351,7 @@ define(['module'], function (module) {
typeof
Components
!==
'
undefined
'
&&
Components
.
classes
&&
Components
.
interfaces
))
{
//Avert your gaze!
Cc
=
Components
.
classes
,
Cc
=
Components
.
classes
;
Ci
=
Components
.
interfaces
;
Components
.
utils
[
'
import
'
](
'
resource://gre/modules/FileUtils.jsm
'
);
xpcIsWindows
=
(
'
@mozilla.org/windows-registry-key;1
'
in
Cc
);
...
...
dependency-examples/flight/bower_components/requirejs/require.js
View file @
a5d0ac74
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment