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
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
Gabriel Monnerat
renderjs
Commits
9a44d661
Commit
9a44d661
authored
Feb 01, 2014
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
index_list: now works + clean console message
parent
1a85fb74
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
22 deletions
+16
-22
examples/fwi/form.js
examples/fwi/form.js
+0
-5
examples/fwi/index_list.js
examples/fwi/index_list.js
+12
-7
examples/fwi/io.js
examples/fwi/io.js
+4
-5
examples/fwi/officejs.js
examples/fwi/officejs.js
+0
-5
No files found.
examples/fwi/form.js
View file @
9a44d661
...
...
@@ -34,13 +34,9 @@
.
declareMethod
(
'
setForm
'
,
function
()
{
return
that
.
declareGadget
(
'
./property.html
'
)
.
then
(
function
(
gadget
){
console
.
log
(
'
prepared property
'
);
property
=
gadget
;
console
.
log
(
property
);
property_context
=
$
(
'
.property_a_safe
'
).
last
();
editor_context
=
$
(
'
.editor_a
'
).
last
();
console
.
log
(
'
property:
'
);
console
.
log
(
property
);
property_context
[
0
].
appendChild
(
property
.
element
);
})
.
fail
(
function
(
error
){
...
...
@@ -66,7 +62,6 @@
});
gk
.
ready
(
function
(
g
)
{
console
.
log
(
'
prepare form
'
);
that
=
g
;
});
}(
window
,
rJS
,
jQuery
,
RSVP
));
\ No newline at end of file
examples/fwi/index_list.js
View file @
9a44d661
...
...
@@ -7,22 +7,27 @@
var
gk
=
rJS
(
window
);
/* Initialize Page List */
gk
.
declareMethod
(
'
setDocumentList
'
,
function
(
document_list
,
editor
,
editor_callback
,
property
,
property_callback
)
{
gk
.
declareMethod
(
'
setDocumentList
'
,
function
(
document_list
,
form
,
form_callback
,
io
,
io_callback
)
{
var
i
,
document
,
index_list_panel
=
$
(
'
#index_list
'
);
for
(
i
=
0
;
i
<
document_list
.
length
;
i
+=
1
)
{
document
=
$
.
extend
({},
document_list
[
i
].
doc
);
index_list_panel
.
append
(
"
<li><a href=#>
"
"
<li><a href='#
"
+
document
.
_id
+
"
'>
"
+
document
.
title
+
"
</a></li>
"
);
index_list_panel
.
find
(
'
a
'
).
last
().
click
(
function
(){
RSVP
.
all
([
editor_callback
.
apply
(
editor
,[
document
.
text_content
]),
property_callback
.
apply
(
property
,
[
document
])
])}
);
var
current_id
=
this
.
hash
.
substr
(
1
);
return
io_callback
.
apply
(
io
,
[
current_id
])
.
then
(
function
(
data
)
{
form_callback
.
apply
(
form
,
[
data
])
})
});
}
});
}(
window
,
rJS
,
jQuery
,
RSVP
));
\ No newline at end of file
examples/fwi/io.js
View file @
9a44d661
...
...
@@ -29,16 +29,15 @@
return
gadget
.
jio
.
put
(
document
);
})
.
declareMethod
(
'
configureDataSourceCallback
'
,
function
(
editor
,
editor_callback
,
property
,
property_callback
,
key
)
{
.
declareMethod
(
'
configureDataSourceCallback
'
,
function
(
form
,
form_callback
)
{
var
g
=
this
;
$
(
g
.
element
).
find
(
'
a
'
).
unbind
(
'
click
'
).
click
(
function
()
{
RSVP
.
all
([
editor_callback
.
apply
(
editor
),
property_callback
.
apply
(
property
)
form_callback
.
apply
(
form
),
])
.
then
(
function
(
result_list
)
{
var
document
=
result_list
[
1
];
document
.
text_content
=
result_list
[
0
];
var
document
=
result_list
[
0
];
return
g
.
setIO
(
document
);
});
});
...
...
examples/fwi/officejs.js
View file @
9a44d661
...
...
@@ -25,7 +25,6 @@
});
})
.
then
(
function
(
document_list
)
{
console
.
log
(
document_list
);
return
RSVP
.
all
([
form
.
setContent
(
document_list
[
0
].
doc
),
index
.
setDocumentList
(
...
...
@@ -127,7 +126,6 @@
.
then
(
function
(
catalog
)
{
// Fetch the list of editor and io gadgets
// This is done in 2 different queries to the catalog
console
.
log
(
'
catalog ready
'
);
return
RSVP
.
all
([
catalog
.
allDocs
(
{
query
:
'
interface: "http://www.renderjs.org/interface/editor"
'
}
...
...
@@ -158,7 +156,6 @@
index_definition
=
index_list
[
0
].
path
,
i
;
// Load 1 editor and 1 IO and plug them
console
.
log
(
'
Ready to prepare
'
);
return
RSVP
.
all
([
g
.
declareGadget
(
blog_list
[
0
].
path
,
...
...
@@ -168,13 +165,11 @@
"
officejs
"
])
.
then
(
function
(
all_param
)
{
console
.
log
(
'
setting blog
'
);
io_blog_a_context
.
empty
();
return
attachIOToBlog
(
all_param
);
})
.
then
(
function
()
{
// Fill the panel
console
.
log
(
'
fill panel
'
);
for
(
i
=
0
;
i
<
blog_list
.
length
;
i
+=
1
)
{
blog_definition
=
blog_list
[
i
];
panel_context
.
append
(
...
...
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