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
8955cfa0
Commit
8955cfa0
authored
Jan 30, 2014
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fwi: blog is the default page
parent
07726f3b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
39 deletions
+26
-39
examples/fwi/catalog.js
examples/fwi/catalog.js
+1
-1
examples/fwi/officejs.html
examples/fwi/officejs.html
+1
-1
examples/fwi/officejs.js
examples/fwi/officejs.js
+24
-37
No files found.
examples/fwi/catalog.js
View file @
8955cfa0
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
},
},
blog_1_dict
=
{
blog_1_dict
=
{
"
path
"
:
"
./blog.html
"
,
"
path
"
:
"
./blog.html
"
,
"
title
"
:
"
Blog
Gadget
"
,
"
title
"
:
"
Blog
"
,
"
interface
"
:
"
http://www.renderjs.org/interface/blog
"
"
interface
"
:
"
http://www.renderjs.org/interface/blog
"
},
},
catalog_list
=
[
catalog_list
=
[
...
...
examples/fwi/officejs.html
View file @
8955cfa0
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
data-iconpos=
"notext"
data-iconpos=
"notext"
data-dismissable=
"false"
>
Menu
</a>
data-dismissable=
"false"
>
Menu
</a>
<h1>
Office JS
</h1>
<h1>
FWI
</h1>
</div>
</div>
<!-- panel -->
<!-- panel -->
...
...
examples/fwi/officejs.js
View file @
8955cfa0
...
@@ -79,6 +79,7 @@
...
@@ -79,6 +79,7 @@
function
createLoadNewEditorCallback
(
g
,
editor_path
,
e_c
,
io_path
,
i_c
)
{
function
createLoadNewEditorCallback
(
g
,
editor_path
,
e_c
,
io_path
,
i_c
)
{
return
function
()
{
return
function
()
{
e_c
.
empty
();
e_c
.
empty
();
$
(
'
.editor_a_safe
'
).
attr
(
"
style
"
,
""
);
return
RSVP
.
all
([
return
RSVP
.
all
([
g
.
declareGadget
(
editor_path
,
{
element
:
e_c
[
0
],
sandbox
:
'
iframe
'
}),
g
.
declareGadget
(
editor_path
,
{
element
:
e_c
[
0
],
sandbox
:
'
iframe
'
}),
g
.
declareGadget
(
io_path
),
g
.
declareGadget
(
io_path
),
...
@@ -96,6 +97,7 @@
...
@@ -96,6 +97,7 @@
function
createLoadNewBlogCallback
(
g
,
blog_path
,
e_c
,
io_path
,
i_c
)
{
function
createLoadNewBlogCallback
(
g
,
blog_path
,
e_c
,
io_path
,
i_c
)
{
return
function
()
{
return
function
()
{
e_c
.
empty
();
e_c
.
empty
();
$
(
'
.editor_a_safe
'
).
attr
(
"
style
"
,
"
display:none
"
);
return
RSVP
.
all
([
return
RSVP
.
all
([
g
.
declareGadget
(
blog_path
,
{
element
:
e_c
[
0
],
sandbox
:
'
iframe
'
}),
g
.
declareGadget
(
blog_path
,
{
element
:
e_c
[
0
],
sandbox
:
'
iframe
'
}),
g
.
declareGadget
(
io_path
),
g
.
declareGadget
(
io_path
),
...
@@ -113,13 +115,10 @@
...
@@ -113,13 +115,10 @@
rJS
(
window
).
ready
(
function
(
g
)
{
rJS
(
window
).
ready
(
function
(
g
)
{
var
editor_a_context
=
$
(
g
.
element
).
find
(
"
.editor_a
"
).
last
(),
var
editor_a_context
=
$
(
g
.
element
).
find
(
"
.editor_a
"
).
last
(),
io_a_context
=
$
(
g
.
element
).
find
(
"
.editor_a_safe
"
).
last
(),
io_a_context
=
$
(
g
.
element
).
find
(
"
.editor_a_safe
"
).
last
(),
io_blog_a_context
=
$
(
g
.
element
).
find
(
"
.blog_a_safe
"
).
last
(),
io_blog_a_context
=
$
(
g
.
element
).
find
(
"
.editor_a_safe
"
).
last
(),
blog_a_context
=
$
(
g
.
element
).
find
(
"
.blog_a
"
).
last
();
blog_a_context
=
$
(
g
.
element
).
find
(
"
.editor_a
"
).
last
();
// editor_b_context = g.context.find(".editor_b").last(),
// io_b_context = g.context.find(".editor_b_safe").last();
// First, load the catalog gadget
// First, load the catalog gadget
console
.
log
(
'
start
'
);
g
.
declareGadget
(
'
./catalog.html
'
)
g
.
declareGadget
(
'
./catalog.html
'
)
.
then
(
function
(
catalog
)
{
.
then
(
function
(
catalog
)
{
// Fetch the list of editor and io gadgets
// Fetch the list of editor and io gadgets
...
@@ -143,60 +142,48 @@
...
@@ -143,60 +142,48 @@
io_list
=
all_list
[
1
],
io_list
=
all_list
[
1
],
blog_list
=
all_list
[
2
],
blog_list
=
all_list
[
2
],
editor_definition
,
editor_definition
,
blog_definition
,
i
;
i
;
console
.
log
(
'
got Catalog Stuff
'
);
// Load 1 editor and 1 IO and plug them
// Load 1 editor and 1 IO and plug them
editor_a_context
.
empty
();
editor_a_context
.
empty
();
$
(
'
.editor_a_safe
'
).
attr
(
"
style
"
,
"
display:none
"
);
return
RSVP
.
all
([
return
RSVP
.
all
([
g
.
declareGadget
(
g
.
declareGadget
(
editor
_list
[
0
].
path
,
blog
_list
[
0
].
path
,
{
element
:
editor
_a_context
[
0
],
sandbox
:
'
iframe
'
}
{
element
:
blog
_a_context
[
0
],
sandbox
:
'
iframe
'
}
),
),
g
.
declareGadget
(
io_list
[
0
].
path
),
// io_a_context),
g
.
declareGadget
(
io_list
[
0
].
path
),
// io_a_context),
"
officejs
"
"
officejs
"
])
])
.
then
(
function
(
all_param
)
{
.
then
(
function
(
all_param
)
{
console
.
log
(
'
Editor Gadget Prepared
'
);
console
.
log
(
'
Editor Gadget Prepared
'
);
io_a_context
.
empty
();
io_a_context
[
0
].
appendChild
(
all_param
[
1
].
element
);
return
attachIOToEditor
(
all_param
);
})
.
then
(
function
(){
return
RSVP
.
all
([
// Load Blog
g
.
declareGadget
(
blog_list
[
0
].
path
,
{
element
:
blog_a_context
[
0
],
sandbox
:
'
iframe
'
}
),
g
.
declareGadget
(
io_list
[
0
].
path
),
// io_blog_a_context),
"
officejs
"
])})
.
then
(
function
(
all_param
)
{
io_blog_a_context
.
empty
();
io_blog_a_context
.
empty
();
io_blog_a_context
[
0
].
appendChild
(
all_param
[
1
].
element
);
io_blog_a_context
[
0
].
appendChild
(
all_param
[
1
].
element
);
return
attachIOToBlog
(
all_param
);
return
attachIOToBlog
(
all_param
);
})
})
.
then
(
function
()
{
.
then
(
function
()
{
// Fill the panel
// Fill the panel
for
(
i
=
0
;
i
<
blog_list
.
length
;
i
+=
1
)
{
blog_definition
=
blog_list
[
i
];
panel_context
.
append
(
'
<a href="#" data-role="button" data-icon="edit"
'
+
'
data-iconpos="left">
'
+
blog_definition
.
title
+
'
</a>
'
);
panel_context
.
find
(
'
a
'
).
last
().
click
(
createLoadNewBlogCallback
(
g
,
blog_definition
.
path
,
blog_a_context
,
io_list
[
0
].
path
,
io_blog_a_context
)
);
}
for
(
i
=
0
;
i
<
editor_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
editor_list
.
length
;
i
+=
1
)
{
editor_definition
=
editor_list
[
i
];
editor_definition
=
editor_list
[
i
];
panel_context
.
append
(
panel_context
.
append
(
'
<a href="#" data-role="button" data-icon="edit"
'
+
'
<a href="#" data-role="button" data-icon="edit"
'
+
'
data-iconpos="left">
'
+
editor_definition
.
title
+
'
</a>
'
'
data-iconpos="left">
'
+
editor_definition
.
title
+
'
</a>
'
);
);
// $(editor_definition.element).click(
panel_context
.
find
(
'
a
'
).
last
().
click
(
panel_context
.
find
(
'
a
'
).
last
().
click
(
createLoadNewEditorCallback
(
g
,
editor_definition
.
path
,
createLoadNewEditorCallback
(
g
,
editor_definition
.
path
,
editor_a_context
,
io_list
[
0
].
path
,
io_a_context
)
editor_a_context
,
io_list
[
0
].
path
,
io_a_context
)
);
);
// XXX Handle links
// panel_context.find('a').last().click(function () {
// $.when(
// g.declareGadget(editor_definition.path,
// editor_a_context),
// g.declareGadget(io_list[0].path, io_a_context),
// "officejs"
// ).done(attachIOToEditor);
// });
}
}
panel_context
.
trigger
(
'
create
'
);
panel_context
.
trigger
(
'
create
'
);
});
});
...
...
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