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
Ivan Tyagov
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
Show 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 @@
...
@@ -34,13 +34,9 @@
.
declareMethod
(
'
setForm
'
,
function
()
{
.
declareMethod
(
'
setForm
'
,
function
()
{
return
that
.
declareGadget
(
'
./property.html
'
)
return
that
.
declareGadget
(
'
./property.html
'
)
.
then
(
function
(
gadget
){
.
then
(
function
(
gadget
){
console
.
log
(
'
prepared property
'
);
property
=
gadget
;
property
=
gadget
;
console
.
log
(
property
);
property_context
=
$
(
'
.property_a_safe
'
).
last
();
property_context
=
$
(
'
.property_a_safe
'
).
last
();
editor_context
=
$
(
'
.editor_a
'
).
last
();
editor_context
=
$
(
'
.editor_a
'
).
last
();
console
.
log
(
'
property:
'
);
console
.
log
(
property
);
property_context
[
0
].
appendChild
(
property
.
element
);
property_context
[
0
].
appendChild
(
property
.
element
);
})
})
.
fail
(
function
(
error
){
.
fail
(
function
(
error
){
...
@@ -66,7 +62,6 @@
...
@@ -66,7 +62,6 @@
});
});
gk
.
ready
(
function
(
g
)
{
gk
.
ready
(
function
(
g
)
{
console
.
log
(
'
prepare form
'
);
that
=
g
;
that
=
g
;
});
});
}(
window
,
rJS
,
jQuery
,
RSVP
));
}(
window
,
rJS
,
jQuery
,
RSVP
));
\ No newline at end of file
examples/fwi/index_list.js
View file @
9a44d661
...
@@ -7,22 +7,27 @@
...
@@ -7,22 +7,27 @@
var
gk
=
rJS
(
window
);
var
gk
=
rJS
(
window
);
/* Initialize Page List */
/* 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
,
var
i
,
document
,
document
,
index_list_panel
=
$
(
'
#index_list
'
);
index_list_panel
=
$
(
'
#index_list
'
);
for
(
i
=
0
;
i
<
document_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
document_list
.
length
;
i
+=
1
)
{
document
=
$
.
extend
({},
document_list
[
i
].
doc
);
document
=
$
.
extend
({},
document_list
[
i
].
doc
);
index_list_panel
.
append
(
index_list_panel
.
append
(
"
<li><a href=#>
"
"
<li><a href='#
"
+
document
.
_id
+
"
'>
"
+
document
.
title
+
document
.
title
+
"
</a></li>
"
);
+
"
</a></li>
"
);
index_list_panel
.
find
(
'
a
'
).
last
().
click
(
function
(){
index_list_panel
.
find
(
'
a
'
).
last
().
click
(
function
(){
RSVP
.
all
([
var
current_id
=
this
.
hash
.
substr
(
1
);
editor_callback
.
apply
(
editor
,[
document
.
text_content
]),
return
io_callback
.
apply
(
io
,
[
current_id
])
property_callback
.
apply
(
property
,
[
document
])
.
then
(
function
(
data
)
{
])}
form_callback
.
apply
(
form
,
[
data
])
);
})
});
}
}
});
});
}(
window
,
rJS
,
jQuery
,
RSVP
));
}(
window
,
rJS
,
jQuery
,
RSVP
));
\ No newline at end of file
examples/fwi/io.js
View file @
9a44d661
...
@@ -29,16 +29,15 @@
...
@@ -29,16 +29,15 @@
return
gadget
.
jio
.
put
(
document
);
return
gadget
.
jio
.
put
(
document
);
})
})
.
declareMethod
(
'
configureDataSourceCallback
'
,
function
(
editor
,
editor_callback
,
property
,
property_callback
,
key
)
{
.
declareMethod
(
'
configureDataSourceCallback
'
,
function
(
form
,
form_callback
)
{
var
g
=
this
;
var
g
=
this
;
$
(
g
.
element
).
find
(
'
a
'
).
unbind
(
'
click
'
).
click
(
function
()
{
$
(
g
.
element
).
find
(
'
a
'
).
unbind
(
'
click
'
).
click
(
function
()
{
RSVP
.
all
([
RSVP
.
all
([
editor_callback
.
apply
(
editor
),
form_callback
.
apply
(
form
),
property_callback
.
apply
(
property
)
])
])
.
then
(
function
(
result_list
)
{
.
then
(
function
(
result_list
)
{
var
document
=
result_list
[
1
];
var
document
=
result_list
[
0
];
document
.
text_content
=
result_list
[
0
];
return
g
.
setIO
(
document
);
return
g
.
setIO
(
document
);
});
});
});
});
...
...
examples/fwi/officejs.js
View file @
9a44d661
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
});
});
})
})
.
then
(
function
(
document_list
)
{
.
then
(
function
(
document_list
)
{
console
.
log
(
document_list
);
return
RSVP
.
all
([
return
RSVP
.
all
([
form
.
setContent
(
document_list
[
0
].
doc
),
form
.
setContent
(
document_list
[
0
].
doc
),
index
.
setDocumentList
(
index
.
setDocumentList
(
...
@@ -127,7 +126,6 @@
...
@@ -127,7 +126,6 @@
.
then
(
function
(
catalog
)
{
.
then
(
function
(
catalog
)
{
// Fetch the list of editor and io gadgets
// Fetch the list of editor and io gadgets
// This is done in 2 different queries to the catalog
// This is done in 2 different queries to the catalog
console
.
log
(
'
catalog ready
'
);
return
RSVP
.
all
([
return
RSVP
.
all
([
catalog
.
allDocs
(
catalog
.
allDocs
(
{
query
:
'
interface: "http://www.renderjs.org/interface/editor"
'
}
{
query
:
'
interface: "http://www.renderjs.org/interface/editor"
'
}
...
@@ -158,7 +156,6 @@
...
@@ -158,7 +156,6 @@
index_definition
=
index_list
[
0
].
path
,
index_definition
=
index_list
[
0
].
path
,
i
;
i
;
// Load 1 editor and 1 IO and plug them
// Load 1 editor and 1 IO and plug them
console
.
log
(
'
Ready to prepare
'
);
return
RSVP
.
all
([
return
RSVP
.
all
([
g
.
declareGadget
(
g
.
declareGadget
(
blog_list
[
0
].
path
,
blog_list
[
0
].
path
,
...
@@ -168,13 +165,11 @@
...
@@ -168,13 +165,11 @@
"
officejs
"
"
officejs
"
])
])
.
then
(
function
(
all_param
)
{
.
then
(
function
(
all_param
)
{
console
.
log
(
'
setting blog
'
);
io_blog_a_context
.
empty
();
io_blog_a_context
.
empty
();
return
attachIOToBlog
(
all_param
);
return
attachIOToBlog
(
all_param
);
})
})
.
then
(
function
()
{
.
then
(
function
()
{
// Fill the panel
// Fill the panel
console
.
log
(
'
fill panel
'
);
for
(
i
=
0
;
i
<
blog_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
blog_list
.
length
;
i
+=
1
)
{
blog_definition
=
blog_list
[
i
];
blog_definition
=
blog_list
[
i
];
panel_context
.
append
(
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