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
Klaus Wölfel
renderjs
Commits
cbf17acf
Commit
cbf17acf
authored
Dec 21, 2012
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sceleton of GadgetCatalog and basic test for it.
parent
b23525a0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
0 deletions
+57
-0
renderjs.js
renderjs.js
+47
-0
test/gadget_index/gagdet_index.json
test/gadget_index/gagdet_index.json
+2
-0
test/renderjs_test.js
test/renderjs_test.js
+8
-0
No files found.
renderjs.js
View file @
cbf17acf
...
...
@@ -549,6 +549,53 @@ var RenderJs = (function () {
};
}()),
GadgetCatalog
:
(
function
()
{
/*
* Gadget catalog provides API to get list of gadgets from a repository
*/
return
{
updateGadgetIndexFromURL
:
function
(
url
)
{
/*
* Update gadget index from a remote repository.
*/
},
setGadgetIndexUrlList
:
function
(
url_list
)
{
/*
* Set list of Gadget Index repositories.
*/
// store in Cache (html5 storage)
var
cache_id
=
"
setGadgetIndexUrlList
"
;
RenderJs
.
Cache
.
set
(
cache_id
,
url_list
)
},
getGadgetIndexUrlList
:
function
()
{
/*
* Get list of Gadget Index repositories.
*/
// get from Cache (html5 storage)
var
cache_id
=
"
setGadgetIndexUrlList
"
;
return
RenderJs
.
Cache
.
get
(
cache_id
,
undefined
)
},
getGadgetListThatProvide
:
function
(
service_list
)
{
/*
* Return list of all gadgets that providen a given service.
* Read this list from data structure created in HTML5 local
* storage by updateGadgetIndexFromURL
*/
// XXX: get from Cache stored index and itterate over it
// to find matching ones
},
registerServiceList
:
function
(
gadget
,
service_list
)
{
/*
* Register a service provided by a gadget.
*/
},
};
}()),
InteractionGadget
:
(
function
()
{
/*
* Basic gadget interaction gadget implementation.
...
...
test/gadget_index/gagdet_index.json
0 → 100644
View file @
cbf17acf
{
"first_name"
:
"John"
,
"last_name"
:
"Doh"
}
\ No newline at end of file
test/renderjs_test.js
View file @
cbf17acf
...
...
@@ -164,5 +164,13 @@ function setupRenderJSTest(){
});
});
module
(
"
GadgetCatalog
"
);
test
(
'
GadgetCatalog
'
,
function
()
{
cleanUp
();
var
url_list
=
new
Array
(
'
gadget_index/gagdet_index.json
'
);
RenderJs
.
GadgetCatalog
.
setGadgetIndexUrlList
(
url_list
)
deepEqual
(
url_list
,
RenderJs
.
GadgetCatalog
.
getGadgetIndexUrlList
());
});
};
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