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
Sven Franck
todomvc
Commits
7adf3303
Commit
7adf3303
authored
Jul 03, 2013
by
Pascal Hartig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sapui: bower-ified app and moved script loading
parent
9d27117f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
226 additions
and
17 deletions
+226
-17
labs/architecture-examples/sapui5/bower.json
labs/architecture-examples/sapui5/bower.json
+7
-0
labs/architecture-examples/sapui5/bower_components/todomvc-common/base.js
...e-examples/sapui5/bower_components/todomvc-common/base.js
+205
-0
labs/architecture-examples/sapui5/bower_components/todomvc-common/bg.png
...re-examples/sapui5/bower_components/todomvc-common/bg.png
+0
-0
labs/architecture-examples/sapui5/css/base.css
labs/architecture-examples/sapui5/css/base.css
+1
-1
labs/architecture-examples/sapui5/index.html
labs/architecture-examples/sapui5/index.html
+13
-16
No files found.
labs/architecture-examples/sapui5/bower.json
0 → 100644
View file @
7adf3303
{
"name"
:
"todomvc-sapui5"
,
"version"
:
"0.0.0"
,
"dependencies"
:
{
"todomvc-common"
:
"~0.1.7"
}
}
labs/architecture-examples/sapui5/bower_components/todomvc-common/base.js
0 → 100644
View file @
7adf3303
(
function
()
{
'
use strict
'
;
// Underscore's Template Module
// Courtesy of underscorejs.org
var
_
=
(
function
(
_
)
{
_
.
defaults
=
function
(
object
)
{
if
(
!
object
)
{
return
object
;
}
for
(
var
argsIndex
=
1
,
argsLength
=
arguments
.
length
;
argsIndex
<
argsLength
;
argsIndex
++
)
{
var
iterable
=
arguments
[
argsIndex
];
if
(
iterable
)
{
for
(
var
key
in
iterable
)
{
if
(
object
[
key
]
==
null
)
{
object
[
key
]
=
iterable
[
key
];
}
}
}
}
return
object
;
}
// By default, Underscore uses ERB-style template delimiters, change the
// following template settings to use alternative delimiters.
_
.
templateSettings
=
{
evaluate
:
/<%
([\s\S]
+
?)
%>/g
,
interpolate
:
/<%=
([\s\S]
+
?)
%>/g
,
escape
:
/<%-
([\s\S]
+
?)
%>/g
};
// When customizing `templateSettings`, if you don't want to define an
// interpolation, evaluation or escaping regex, we need one that is
// guaranteed not to match.
var
noMatch
=
/
(
.
)
^/
;
// Certain characters need to be escaped so that they can be put into a
// string literal.
var
escapes
=
{
"
'
"
:
"
'
"
,
'
\\
'
:
'
\\
'
,
'
\r
'
:
'
r
'
,
'
\n
'
:
'
n
'
,
'
\t
'
:
'
t
'
,
'
\
u2028
'
:
'
u2028
'
,
'
\
u2029
'
:
'
u2029
'
};
var
escaper
=
/
\\
|'|
\r
|
\n
|
\t
|
\u
2028|
\u
2029/g
;
// JavaScript micro-templating, similar to John Resig's implementation.
// Underscore templating handles arbitrary delimiters, preserves whitespace,
// and correctly escapes quotes within interpolated code.
_
.
template
=
function
(
text
,
data
,
settings
)
{
var
render
;
settings
=
_
.
defaults
({},
settings
,
_
.
templateSettings
);
// Combine delimiters into one regular expression via alternation.
var
matcher
=
new
RegExp
([
(
settings
.
escape
||
noMatch
).
source
,
(
settings
.
interpolate
||
noMatch
).
source
,
(
settings
.
evaluate
||
noMatch
).
source
].
join
(
'
|
'
)
+
'
|$
'
,
'
g
'
);
// Compile the template source, escaping string literals appropriately.
var
index
=
0
;
var
source
=
"
__p+='
"
;
text
.
replace
(
matcher
,
function
(
match
,
escape
,
interpolate
,
evaluate
,
offset
)
{
source
+=
text
.
slice
(
index
,
offset
)
.
replace
(
escaper
,
function
(
match
)
{
return
'
\\
'
+
escapes
[
match
];
});
if
(
escape
)
{
source
+=
"
'+
\n
((__t=(
"
+
escape
+
"
))==null?'':_.escape(__t))+
\n
'
"
;
}
if
(
interpolate
)
{
source
+=
"
'+
\n
((__t=(
"
+
interpolate
+
"
))==null?'':__t)+
\n
'
"
;
}
if
(
evaluate
)
{
source
+=
"
';
\n
"
+
evaluate
+
"
\n
__p+='
"
;
}
index
=
offset
+
match
.
length
;
return
match
;
});
source
+=
"
';
\n
"
;
// If a variable is not specified, place data values in local scope.
if
(
!
settings
.
variable
)
source
=
'
with(obj||{}){
\n
'
+
source
+
'
}
\n
'
;
source
=
"
var __t,__p='',__j=Array.prototype.join,
"
+
"
print=function(){__p+=__j.call(arguments,'');};
\n
"
+
source
+
"
return __p;
\n
"
;
try
{
render
=
new
Function
(
settings
.
variable
||
'
obj
'
,
'
_
'
,
source
);
}
catch
(
e
)
{
e
.
source
=
source
;
throw
e
;
}
if
(
data
)
return
render
(
data
,
_
);
var
template
=
function
(
data
)
{
return
render
.
call
(
this
,
data
,
_
);
};
// Provide the compiled function source as a convenience for precompilation.
template
.
source
=
'
function(
'
+
(
settings
.
variable
||
'
obj
'
)
+
'
){
\n
'
+
source
+
'
}
'
;
return
template
;
};
return
_
;
})({});
if
(
location
.
hostname
===
'
todomvc.com
'
)
{
window
.
_gaq
=
[[
'
_setAccount
'
,
'
UA-31081062-1
'
],[
'
_trackPageview
'
]];(
function
(
d
,
t
){
var
g
=
d
.
createElement
(
t
),
s
=
d
.
getElementsByTagName
(
t
)[
0
];
g
.
src
=
'
//www.google-analytics.com/ga.js
'
;
s
.
parentNode
.
insertBefore
(
g
,
s
)}(
document
,
'
script
'
));
}
function
redirect
()
{
if
(
location
.
hostname
===
'
tastejs.github.io
'
)
{
location
.
href
=
location
.
href
.
replace
(
'
tastejs.github.io/todomvc
'
,
'
todomvc.com
'
);
}
}
function
findRoot
()
{
var
base
;
[
/labs/
,
/
\w
*-examples/
].
forEach
(
function
(
href
)
{
var
match
=
location
.
href
.
match
(
href
);
if
(
!
base
&&
match
)
{
base
=
location
.
href
.
indexOf
(
match
);
}
});
return
location
.
href
.
substr
(
0
,
base
);
}
function
getFile
(
file
,
callback
)
{
var
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
'
GET
'
,
findRoot
()
+
file
,
true
);
xhr
.
send
();
xhr
.
onload
=
function
()
{
if
(
xhr
.
status
===
200
&&
callback
)
{
callback
(
xhr
.
responseText
);
}
};
}
function
Learn
(
learnJSON
,
config
)
{
if
(
!
(
this
instanceof
Learn
))
{
return
new
Learn
(
learnJSON
,
config
);
}
var
template
,
framework
;
if
(
typeof
learnJSON
!==
'
object
'
)
{
try
{
learnJSON
=
JSON
.
parse
(
learnJSON
);
}
catch
(
e
)
{
return
;
}
}
if
(
config
)
{
template
=
config
.
template
;
framework
=
config
.
framework
;
}
if
(
!
template
&&
learnJSON
.
templates
)
{
template
=
learnJSON
.
templates
.
todomvc
;
}
if
(
!
framework
&&
document
.
querySelector
(
'
[data-framework]
'
))
{
framework
=
document
.
querySelector
(
'
[data-framework]
'
).
getAttribute
(
'
data-framework
'
);
}
if
(
template
&&
learnJSON
[
framework
])
{
this
.
frameworkJSON
=
learnJSON
[
framework
];
this
.
template
=
template
;
this
.
append
();
}
}
Learn
.
prototype
.
append
=
function
()
{
var
aside
=
document
.
createElement
(
'
aside
'
);
aside
.
innerHTML
=
_
.
template
(
this
.
template
,
this
.
frameworkJSON
);
aside
.
className
=
'
learn
'
;
// Localize demo links
var
demoLinks
=
aside
.
querySelectorAll
(
'
.demo-link
'
);
Array
.
prototype
.
forEach
.
call
(
demoLinks
,
function
(
demoLink
)
{
demoLink
.
setAttribute
(
'
href
'
,
findRoot
()
+
demoLink
.
getAttribute
(
'
href
'
));
});
document
.
body
.
className
=
(
document
.
body
.
className
+
'
learn-bar
'
).
trim
();
document
.
body
.
insertAdjacentHTML
(
'
afterBegin
'
,
aside
.
outerHTML
);
};
redirect
();
getFile
(
'
learn.json
'
,
Learn
);
})();
labs/architecture-examples/sapui5/bower_components/todomvc-common/bg.png
0 → 100644
View file @
7adf3303
2.08 KB
labs/architecture-examples/sapui5/css/base.css
View file @
7adf3303
...
...
@@ -23,7 +23,7 @@ button {
body
{
font
:
14px
'Helvetica Neue'
,
Helvetica
,
Arial
,
sans-serif
;
line-height
:
1.4em
;
background
:
#eaeaea
url('../
img
/bg.png')
;
background
:
#eaeaea
url('../
bower_components/todomvc-common
/bg.png')
;
color
:
#4d4d4d
;
width
:
550px
;
margin
:
0
auto
;
...
...
labs/architecture-examples/sapui5/index.html
View file @
7adf3303
<!
DOCTYPE HTML
>
<html>
<!
doctype html
>
<html
lang=
"en"
data-framework=
"sapui5"
>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<title>
SAPUI5 • TodoMVC
</title>
<script
src=
"https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js"
id=
"sap-ui-bootstrap"
data-sap-ui-libs=
"sap.ui.commons,sap.ui.ux3,sap.ui.table"
data-sap-ui-theme=
"base"
>
</script>
<link
href=
"css/base.css"
rel=
"stylesheet"
type=
"text/css"
>
<script
src=
"js/app.js"
></script>
<link
href=
"css/base.css"
rel=
"stylesheet"
>
</head>
<body
role=
"application"
>
<section
id=
"todoapp"
>
...
...
@@ -26,8 +15,16 @@
</section>
<footer
id=
"info"
>
<p>
Double-click to edit a todo
</p>
<p>
Written by Harald Schubert
. Based on SAP UI5.
</p>
<p>
Part of
<a
href=
"http://todomvc.com/"
>
TodoMVC
</a>
.
</p>
<p>
Written by Harald Schubert
</p>
<p>
Part of
<a
href=
"http://todomvc.com/"
>
TodoMVC
</a></p>
</footer>
<script
src=
"https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js"
id=
"sap-ui-bootstrap"
data-sap-ui-libs=
"sap.ui.commons,sap.ui.ux3,sap.ui.table"
data-sap-ui-theme=
"base"
>
</script>
<script
src=
"bower_components/todomvc-common/base.js"
></script>
<script
src=
"js/app.js"
></script>
</body>
</html>
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