Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
renderjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
renderjs
Commits
83d9304c
Commit
83d9304c
authored
Nov 14, 2012
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add example how a gadget may require its own javascript files to be
loaded using requirejs.
parent
c8ad49b4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
0 deletions
+37
-0
examples/requirejs_gadget_dependency_load/index.html
examples/requirejs_gadget_dependency_load/index.html
+13
-0
examples/requirejs_gadget_dependency_load/require-gadget-implementation.js
...s_gadget_dependency_load/require-gadget-implementation.js
+5
-0
examples/requirejs_gadget_dependency_load/require-gadget.js
examples/requirejs_gadget_dependency_load/require-gadget.js
+7
-0
examples/requirejs_gadget_dependency_load/requirejs-gadget.html
...es/requirejs_gadget_dependency_load/requirejs-gadget.html
+12
-0
No files found.
examples/requirejs_gadget_dependency_load/index.html
0 → 100644
View file @
83d9304c
<html>
<head>
<script
data-main=
"../../require-renderjs.js"
type=
"text/javascript"
src=
"../../lib/require/require.js"
></script>
<head>
<body>
<div
id=
"requirejs-gadget"
data-gadget=
"requirejs-gadget.html"
data-gadget-cacheable=
"0"
data-gadget-cache-id=
"requirejs-gadget"
></div>
</body>
</html>
\ No newline at end of file
examples/requirejs_gadget_dependency_load/require-gadget-implementation.js
0 → 100644
View file @
83d9304c
// This module contains gagdets JavaScript implementation code
function
setLoaded
()
{
$
(
"
#loading
"
).
text
(
'
Loaded now using requirejs.
'
);
}
\ No newline at end of file
examples/requirejs_gadget_dependency_load/require-gadget.js
0 → 100644
View file @
83d9304c
// This file defines all required javascript files for this gadget
require
([
"
require-gadget-implementation.js
"
],
function
(
domReady
)
{
// required by this gadget code is loaded so we can use it
setLoaded
();
});
examples/requirejs_gadget_dependency_load/requirejs-gadget.html
0 → 100644
View file @
83d9304c
<html>
<head>
<script
type=
"text/javascript"
src=
"require-gadget.js"
></script>
</head>
<body>
<p>
This gadget uses requirejs to load its dependency.
</p>
<div
id=
"loading"
>
Loading ....
</div>
</body>
</html>
\ No newline at end of file
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