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
9df98e41
Commit
9df98e41
authored
Nov 22, 2014
by
Olivier Scherrer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Olives: Update Olives and Emily to latest 1.x versions
parent
b9c3b488
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
3934 additions
and
2909 deletions
+3934
-2909
examples/olives/bower.json
examples/olives/bower.json
+2
-2
examples/olives/bower_components/emily/build/Emily.js
examples/olives/bower_components/emily/build/Emily.js
+1423
-1005
examples/olives/bower_components/olives/build/Olives.js
examples/olives/bower_components/olives/build/Olives.js
+1518
-964
examples/olives/bower_components/olives/src/Bind.plugin.js
examples/olives/bower_components/olives/src/Bind.plugin.js
+604
-573
examples/olives/bower_components/olives/src/DomUtils.js
examples/olives/bower_components/olives/src/DomUtils.js
+2
-0
examples/olives/bower_components/olives/src/Event.plugin.js
examples/olives/bower_components/olives/src/Event.plugin.js
+118
-116
examples/olives/bower_components/olives/src/LocalStore.js
examples/olives/bower_components/olives/src/LocalStore.js
+3
-1
examples/olives/bower_components/olives/src/OObject.js
examples/olives/bower_components/olives/src/OObject.js
+180
-174
examples/olives/bower_components/olives/src/Place.plugin.js
examples/olives/bower_components/olives/src/Place.plugin.js
+67
-65
examples/olives/bower_components/olives/src/Plugins.js
examples/olives/bower_components/olives/src/Plugins.js
+2
-0
examples/olives/bower_components/olives/src/SocketIOTransport.js
...s/olives/bower_components/olives/src/SocketIOTransport.js
+15
-9
No files found.
examples/olives/bower.json
View file @
9df98e41
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
"name"
:
"todomvc-olives"
,
"name"
:
"todomvc-olives"
,
"version"
:
"0.0.0"
,
"version"
:
"0.0.0"
,
"dependencies"
:
{
"dependencies"
:
{
"olives"
:
"~1.
4
.0"
,
"olives"
:
"~1.
6
.0"
,
"emily"
:
"~1.
3.5
"
,
"emily"
:
"~1.
8.1
"
,
"requirejs"
:
"~2.1.5"
,
"requirejs"
:
"~2.1.5"
,
"todomvc-common"
:
"~0.3.0"
"todomvc-common"
:
"~0.3.0"
}
}
...
...
examples/olives/bower_components/emily/build/Emily.js
View file @
9df98e41
This diff is collapsed.
Click to expand it.
examples/olives/bower_components/olives/build/Olives.js
View file @
9df98e41
This diff is collapsed.
Click to expand it.
examples/olives/bower_components/olives/src/Bind.plugin.js
View file @
9df98e41
This diff is collapsed.
Click to expand it.
examples/olives/bower_components/olives/src/DomUtils.js
View file @
9df98e41
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
define
([
"
Tools
"
],
function
(
Tools
)
{
define
([
"
Tools
"
],
function
(
Tools
)
{
"
use strict
"
;
return
{
return
{
/**
/**
* Returns a NodeList including the given dom node,
* Returns a NodeList including the given dom node,
...
...
examples/olives/bower_components/olives/src/Event.plugin.js
View file @
9df98e41
...
@@ -14,121 +14,123 @@ define(["DomUtils"],
...
@@ -14,121 +14,123 @@ define(["DomUtils"],
*/
*/
function
EventPlugin
(
Utils
)
{
function
EventPlugin
(
Utils
)
{
/**
"
use strict
"
;
* The event plugin constructor.
* ex: new EventPlugin({method: function(){} ...}, false);
/**
* @param {Object} the object that has the event handling methods
* The event plugin constructor.
* @param {Boolean} $isMobile if the event handler has to map with touch events
* ex: new EventPlugin({method: function(){} ...}, false);
*/
* @param {Object} the object that has the event handling methods
return
function
EventPluginConstructor
(
$parent
,
$isMobile
)
{
* @param {Boolean} $isMobile if the event handler has to map with touch events
*/
/**
return
function
EventPluginConstructor
(
$parent
,
$isMobile
)
{
* The parent callback
* @private
/**
*/
* The parent callback
var
_parent
=
null
,
* @private
*/
/**
var
_parent
=
null
,
* The mapping object.
* @private
/**
*/
* The mapping object.
_map
=
{
* @private
"
mousedown
"
:
"
touchstart
"
,
*/
"
mouseup
"
:
"
touchend
"
,
_map
=
{
"
mousemove
"
:
"
touchmove
"
"
mousedown
"
:
"
touchstart
"
,
},
"
mouseup
"
:
"
touchend
"
,
"
mousemove
"
:
"
touchmove
"
/**
},
* Is touch device.
* @private
/**
*/
* Is touch device.
_isMobile
=
!!
$isMobile
;
* @private
*/
/**
_isMobile
=
!!
$isMobile
;
* Add mapped event listener (for testing purpose).
* @private
/**
*/
* Add mapped event listener (for testing purpose).
this
.
addEventListener
=
function
addEventListener
(
node
,
event
,
callback
,
useCapture
)
{
* @private
node
.
addEventListener
(
this
.
map
(
event
),
callback
,
!!
useCapture
);
*/
};
this
.
addEventListener
=
function
addEventListener
(
node
,
event
,
callback
,
useCapture
)
{
node
.
addEventListener
(
this
.
map
(
event
),
callback
,
!!
useCapture
);
/**
};
* Listen to DOM events.
* @param {Object} node DOM node
/**
* @param {String} name event's name
* Listen to DOM events.
* @param {String} listener callback's name
* @param {Object} node DOM node
* @param {String} useCapture string
* @param {String} name event's name
*/
* @param {String} listener callback's name
this
.
listen
=
function
listen
(
node
,
name
,
listener
,
useCapture
)
{
* @param {String} useCapture string
this
.
addEventListener
(
node
,
name
,
function
(
e
){
*/
_parent
[
listener
].
call
(
_parent
,
e
,
node
);
this
.
listen
=
function
listen
(
node
,
name
,
listener
,
useCapture
)
{
},
!!
useCapture
);
this
.
addEventListener
(
node
,
name
,
function
(
e
){
};
_parent
[
listener
].
call
(
_parent
,
e
,
node
);
},
!!
useCapture
);
/**
};
* Delegate the event handling to a parent DOM element
* @param {Object} node DOM node
/**
* @param {String} selector CSS3 selector to the element that listens to the event
* Delegate the event handling to a parent DOM element
* @param {String} name event's name
* @param {Object} node DOM node
* @param {String} listener callback's name
* @param {String} selector CSS3 selector to the element that listens to the event
* @param {String} useCapture string
* @param {String} name event's name
*/
* @param {String} listener callback's name
this
.
delegate
=
function
delegate
(
node
,
selector
,
name
,
listener
,
useCapture
)
{
* @param {String} useCapture string
this
.
addEventListener
(
node
,
name
,
function
(
event
){
*/
if
(
Utils
.
matches
(
node
,
selector
,
event
.
target
))
{
this
.
delegate
=
function
delegate
(
node
,
selector
,
name
,
listener
,
useCapture
)
{
_parent
[
listener
].
call
(
_parent
,
event
,
node
);
this
.
addEventListener
(
node
,
name
,
function
(
event
){
}
if
(
Utils
.
matches
(
node
,
selector
,
event
.
target
))
{
},
!!
useCapture
);
_parent
[
listener
].
call
(
_parent
,
event
,
node
);
};
}
},
!!
useCapture
);
/**
};
* Get the parent object.
* @return {Object} the parent object
/**
*/
* Get the parent object.
this
.
getParent
=
function
getParent
()
{
* @return {Object} the parent object
return
_parent
;
*/
};
this
.
getParent
=
function
getParent
()
{
return
_parent
;
/**
};
* Set the parent object.
* The parent object is an object which the functions are called by node listeners.
/**
* @param {Object} the parent object
* Set the parent object.
* @return true if object has been set
* The parent object is an object which the functions are called by node listeners.
*/
* @param {Object} the parent object
this
.
setParent
=
function
setParent
(
parent
)
{
* @return true if object has been set
if
(
parent
instanceof
Object
){
*/
_parent
=
parent
;
this
.
setParent
=
function
setParent
(
parent
)
{
return
true
;
if
(
parent
instanceof
Object
){
}
_parent
=
parent
;
return
false
;
return
true
;
};
}
return
false
;
/**
};
* Get event mapping.
* @param {String} event's name
/**
* @return the mapped event's name
* Get event mapping.
*/
* @param {String} event's name
this
.
map
=
function
map
(
name
)
{
* @return the mapped event's name
return
_isMobile
?
(
_map
[
name
]
||
name
)
:
name
;
*/
};
this
.
map
=
function
map
(
name
)
{
return
_isMobile
?
(
_map
[
name
]
||
name
)
:
name
;
/**
};
* Set event mapping.
* @param {String} event's name
/**
* @param {String} event's value
* Set event mapping.
* @return true if mapped
* @param {String} event's name
*/
* @param {String} event's value
this
.
setMap
=
function
setMap
(
name
,
value
)
{
* @return true if mapped
if
(
typeof
name
==
"
string
"
&&
*/
typeof
value
==
"
string
"
)
{
this
.
setMap
=
function
setMap
(
name
,
value
)
{
_map
[
name
]
=
value
;
if
(
typeof
name
==
"
string
"
&&
return
true
;
typeof
value
==
"
string
"
)
{
}
_map
[
name
]
=
value
;
return
false
;
return
true
;
};
}
return
false
;
//init
};
this
.
setParent
(
$parent
);
};
//init
this
.
setParent
(
$parent
);
};
});
});
examples/olives/bower_components/olives/src/LocalStore.js
View file @
9df98e41
...
@@ -15,6 +15,8 @@ define(["Store", "Tools"],
...
@@ -15,6 +15,8 @@ define(["Store", "Tools"],
*/
*/
function
LocalStore
(
Store
,
Tools
)
{
function
LocalStore
(
Store
,
Tools
)
{
"
use strict
"
;
function
LocalStoreConstructor
()
{
function
LocalStoreConstructor
()
{
/**
/**
...
@@ -96,7 +98,7 @@ function LocalStore(Store, Tools) {
...
@@ -96,7 +98,7 @@ function LocalStore(Store, Tools) {
return
function
LocalStoreFactory
(
init
)
{
return
function
LocalStoreFactory
(
init
)
{
LocalStoreConstructor
.
prototype
=
new
Store
(
init
);
LocalStoreConstructor
.
prototype
=
new
Store
(
init
);
return
new
LocalStoreConstructor
;
return
new
LocalStoreConstructor
()
;
};
};
});
});
examples/olives/bower_components/olives/src/OObject.js
View file @
9df98e41
This diff is collapsed.
Click to expand it.
examples/olives/bower_components/olives/src/Place.plugin.js
View file @
9df98e41
...
@@ -12,77 +12,79 @@ define(["OObject", "Tools"],
...
@@ -12,77 +12,79 @@ define(["OObject", "Tools"],
*/
*/
function
PlacePlugin
(
OObject
,
Tools
)
{
function
PlacePlugin
(
OObject
,
Tools
)
{
/**
"
use strict
"
;
* Intilialize a Place.plugin with a list of OObjects
* @param {Object} $uis a list of OObjects such as:
* {
* "header": new OObject(),
* "list": new OObject()
* }
* @Constructor
*/
return
function
PlacePluginConstructor
(
$uis
)
{
/**
/**
* The list of uis currently set in this place plugin
* Intilialize a Place.plugin with a list of OObjects
* @private
* @param {Object} $uis a list of OObjects such as:
*/
* {
var
_uis
=
{};
* "header": new OObject(),
* "list": new OObject()
* }
* @Constructor
*/
return
function
PlacePluginConstructor
(
$uis
)
{
/**
/**
* Attach an OObject to this DOM element
* The list of uis currently set in this place plugin
* @param {HTML|SVGElement} node the dom node where to attach the OObject
* @private
* @param {String} the name of the OObject to attach
*/
* @throws {NoSuchOObject} an error if there's no OObject for the given name
var
_uis
=
{};
*/
this
.
place
=
function
place
(
node
,
name
)
{
if
(
_uis
[
name
]
instanceof
OObject
)
{
_uis
[
name
].
place
(
node
);
}
else
{
throw
new
Error
(
name
+
"
is not an OObject UI in place:
"
+
name
);
}
};
/**
/**
* Add an OObject that can be attached to a dom element
* Attach an OObject to this DOM element
* @param {String} the name of the OObject to add to the list
* @param {HTML|SVGElement} node the dom node where to attach the OObject
* @param {OObject} ui the OObject to add the list
* @param {String} the name of the OObject to attach
* @returns {Boolean} true if the OObject was added
* @throws {NoSuchOObject} an error if there's no OObject for the given name
*/
*/
this
.
set
=
function
set
(
name
,
ui
)
{
this
.
place
=
function
place
(
node
,
name
)
{
if
(
typeof
name
==
"
string
"
&&
ui
instanceof
OObject
)
{
if
(
_uis
[
name
]
instanceof
OObject
)
{
_uis
[
name
]
=
ui
;
_uis
[
name
].
place
(
node
);
return
true
;
}
else
{
}
else
{
throw
new
Error
(
name
+
"
is not an OObject UI in place:
"
+
name
);
return
false
;
}
}
};
};
/**
/**
* Add multiple dom elements at once
* Add an OObject that can be attached to a dom element
* @param {Object} $uis a list of OObjects such as:
* @param {String} the name of the OObject to add to the list
* {
* @param {OObject} ui the OObject to add the list
* "header": new OObject(),
* @returns {Boolean} true if the OObject was added
* "list": new OObject()
*/
* }
this
.
set
=
function
set
(
name
,
ui
)
{
*/
if
(
typeof
name
==
"
string
"
&&
ui
instanceof
OObject
)
{
this
.
setAll
=
function
setAll
(
uis
)
{
_uis
[
name
]
=
ui
;
Tools
.
loop
(
uis
,
function
(
ui
,
name
)
{
return
true
;
this
.
set
(
name
,
ui
);
}
else
{
},
this
);
return
false
;
};
}
};
/**
/**
* Returns an OObject from the list given its name
* Add multiple dom elements at once
* @param {String} the name of the OObject to get
* @param {Object} $uis a list of OObjects such as:
* @returns {OObject} OObject for the given name
* {
*/
* "header": new OObject(),
this
.
get
=
function
get
(
name
)
{
* "list": new OObject()
return
_uis
[
name
];
* }
};
*/
this
.
setAll
=
function
setAll
(
uis
)
{
Tools
.
loop
(
uis
,
function
(
ui
,
name
)
{
this
.
set
(
name
,
ui
);
},
this
);
};
this
.
setAll
(
$uis
);
/**
* Returns an OObject from the list given its name
* @param {String} the name of the OObject to get
* @returns {OObject} OObject for the given name
*/
this
.
get
=
function
get
(
name
)
{
return
_uis
[
name
];
};
};
this
.
setAll
(
$uis
);
};
});
});
examples/olives/bower_components/olives/src/Plugins.js
View file @
9df98e41
...
@@ -17,6 +17,8 @@ define(["Tools", "DomUtils"],
...
@@ -17,6 +17,8 @@ define(["Tools", "DomUtils"],
*/
*/
function
Plugins
(
Tools
,
DomUtils
)
{
function
Plugins
(
Tools
,
DomUtils
)
{
"
use strict
"
;
return
function
PluginsConstructor
(
$plugins
)
{
return
function
PluginsConstructor
(
$plugins
)
{
/**
/**
...
...
examples/olives/bower_components/olives/src/SocketIOTransport.js
View file @
9df98e41
...
@@ -12,6 +12,8 @@ define(["Observable", "Tools"],
...
@@ -12,6 +12,8 @@ define(["Observable", "Tools"],
*/
*/
function
SocketIOTransport
(
Observable
,
Tools
)
{
function
SocketIOTransport
(
Observable
,
Tools
)
{
"
use strict
"
;
/**
/**
* Defines the SocketIOTransport
* Defines the SocketIOTransport
* @private
* @private
...
@@ -47,7 +49,7 @@ function SocketIOTransport(Observable, Tools) {
...
@@ -47,7 +49,7 @@ function SocketIOTransport(Observable, Tools) {
*/
*/
this
.
getSocket
=
function
getSocket
()
{
this
.
getSocket
=
function
getSocket
()
{
return
_socket
;
return
_socket
;
}
,
}
;
/**
/**
* Subscribe to a socket event
* Subscribe to a socket event
...
@@ -56,7 +58,7 @@ function SocketIOTransport(Observable, Tools) {
...
@@ -56,7 +58,7 @@ function SocketIOTransport(Observable, Tools) {
*/
*/
this
.
on
=
function
on
(
event
,
func
)
{
this
.
on
=
function
on
(
event
,
func
)
{
return
_socket
.
on
(
event
,
func
);
return
_socket
.
on
(
event
,
func
);
}
,
}
;
/**
/**
* Subscribe to a socket event but disconnect as soon as it fires.
* Subscribe to a socket event but disconnect as soon as it fires.
...
@@ -95,15 +97,17 @@ function SocketIOTransport(Observable, Tools) {
...
@@ -95,15 +97,17 @@ function SocketIOTransport(Observable, Tools) {
* @param {Object} scope the scope in which to execute the callback
* @param {Object} scope the scope in which to execute the callback
*/
*/
this
.
request
=
function
request
(
channel
,
data
,
func
,
scope
)
{
this
.
request
=
function
request
(
channel
,
data
,
func
,
scope
)
{
if
(
typeof
channel
==
"
string
"
if
(
typeof
channel
==
"
string
"
&&
&&
typeof
data
!=
"
undefined
"
)
{
typeof
data
!=
"
undefined
"
)
{
var
reqData
=
{
var
reqData
=
{
eventId
:
Date
.
now
()
+
Math
.
floor
(
Math
.
random
()
*
1
e6
),
eventId
:
Date
.
now
()
+
Math
.
floor
(
Math
.
random
()
*
1
e6
),
data
:
data
data
:
data
},
},
boundCallback
=
function
()
{
boundCallback
=
function
()
{
func
&&
func
.
apply
(
scope
||
null
,
arguments
);
if
(
func
)
{
func
.
apply
(
scope
||
null
,
arguments
);
}
};
};
this
.
once
(
reqData
.
eventId
,
boundCallback
);
this
.
once
(
reqData
.
eventId
,
boundCallback
);
...
@@ -125,9 +129,9 @@ function SocketIOTransport(Observable, Tools) {
...
@@ -125,9 +129,9 @@ function SocketIOTransport(Observable, Tools) {
* @returns
* @returns
*/
*/
this
.
listen
=
function
listen
(
channel
,
data
,
func
,
scope
)
{
this
.
listen
=
function
listen
(
channel
,
data
,
func
,
scope
)
{
if
(
typeof
channel
==
"
string
"
if
(
typeof
channel
==
"
string
"
&&
&&
typeof
data
!=
"
undefined
"
typeof
data
!=
"
undefined
"
&&
&&
typeof
func
==
"
function
"
)
{
typeof
func
==
"
function
"
)
{
var
reqData
=
{
var
reqData
=
{
eventId
:
Date
.
now
()
+
Math
.
floor
(
Math
.
random
()
*
1
e6
),
eventId
:
Date
.
now
()
+
Math
.
floor
(
Math
.
random
()
*
1
e6
),
...
@@ -135,7 +139,9 @@ function SocketIOTransport(Observable, Tools) {
...
@@ -135,7 +139,9 @@ function SocketIOTransport(Observable, Tools) {
keepAlive
:
true
keepAlive
:
true
},
},
boundCallback
=
function
()
{
boundCallback
=
function
()
{
func
&&
func
.
apply
(
scope
||
null
,
arguments
);
if
(
func
)
{
func
.
apply
(
scope
||
null
,
arguments
);
}
},
},
that
=
this
;
that
=
this
;
...
...
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