Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
renderjs
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
Romain Courteaud
renderjs
Commits
f3c2b113
Commit
f3c2b113
authored
Feb 20, 2013
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use dedicated gadget to show and auto hide messages.
Recreate default route using proper RouteGadget.
parent
e417ed3b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
examples/route/gadget-portal-status-message.html
examples/route/gadget-portal-status-message.html
+18
-0
examples/route/index.html
examples/route/index.html
+3
-0
examples/route/require-renderjs_route.js
examples/route/require-renderjs_route.js
+3
-2
No files found.
examples/route/gadget-portal-status-message.html
0 → 100644
View file @
f3c2b113
<html>
<head></head>
<body>
<script
type=
"text/javascript"
language=
"javascript"
>
//
<!
[
CDATA
[
$
(
document
).
ready
(
function
()
{
gadget
=
RenderJs
.
getSelfGadget
();
gadget
.
showMessage
=
function
(
msg
){
$
(
"
#portal-status-message
"
).
html
(
msg
);
window
.
setTimeout
(
function
()
{
$
(
"
#portal-status-message
"
).
empty
();
},
2000
);
};
});
//]]>
</script>
</body>
</html>
examples/route/index.html
View file @
f3c2b113
...
@@ -12,6 +12,9 @@
...
@@ -12,6 +12,9 @@
</head>
</head>
<body>
<body>
<div
id=
"portal-status-message"
data-gadget=
"gadget-portal-status-message.html"
></div>
<div
data-gadget=
""
<div
data-gadget=
""
id=
"main-router"
id=
"main-router"
data-gadget-route=
"[
data-gadget-route=
"[
...
...
examples/route/require-renderjs_route.js
View file @
f3c2b113
...
@@ -33,11 +33,12 @@ require([ "renderjs", "require-renderjs", "jquery", "route", "url" ], function(d
...
@@ -33,11 +33,12 @@ require([ "renderjs", "require-renderjs", "jquery", "route", "url" ], function(d
RenderJs
.
RouteGadget
.
go
(
$
.
url
.
getPath
(),
RenderJs
.
RouteGadget
.
go
(
$
.
url
.
getPath
(),
function
()
{
function
()
{
// Method to display error to the user
// Method to display error to the user
$
(
this
).
html
(
gadget
=
RenderJs
.
GadgetIndex
.
getGadgetById
(
"
portal-status-message
"
);
gadget
.
showMessage
(
"
<p>Oups, seems the route '<b>
"
+
$
.
url
.
getPath
()
+
"
<
\
/b>' doesn't exist!<
\
/p>
"
+
"
<p>Oups, seems the route '<b>
"
+
$
.
url
.
getPath
()
+
"
<
\
/b>' doesn't exist!<
\
/p>
"
+
"
<a href='
"
+
$
.
url
.
generateUrl
(
""
)
+
"
'>Go back to home<
\
/a>
"
);
"
<a href='
"
+
$
.
url
.
generateUrl
(
""
)
+
"
'>Go back to home<
\
/a>
"
);
// All routes have been deleted by fail.
// All routes have been deleted by fail.
//
XXX: R
ecreate the default routes using RouteGadget
//
So r
ecreate the default routes using RouteGadget
$
(
"
div[data-gadget-route]
"
).
each
(
function
(
index
,
element
)
{
$
(
"
div[data-gadget-route]
"
).
each
(
function
(
index
,
element
)
{
RenderJs
.
RouteGadget
.
route
(
$
(
element
));
RenderJs
.
RouteGadget
.
route
(
$
(
element
));
});
});
...
...
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