Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
264ca7e3
Commit
264ca7e3
authored
Aug 24, 2012
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RenderJs uses now custom HTML5 element attributes which have a leading
"data-" prefix.
parent
8971cb24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
OfficeJS/src/renderjs/renderjs.js
OfficeJS/src/renderjs/renderjs.js
+8
-8
No files found.
OfficeJS/src/renderjs/renderjs.js
View file @
264ca7e3
...
...
@@ -25,7 +25,7 @@ var RenderJs = (function () {
load
:
function
(
root
)
{
/* Load gadget layout by traversing DOM */
var
gadget_list
;
gadget_list
=
root
.
find
(
"
[gadget]
"
);
gadget_list
=
root
.
find
(
"
[
data-
gadget]
"
);
// Load chilren
gadget_list
.
each
(
function
()
{
RenderJs
.
loadGadgetFromUrl
(
$
(
this
));
...
...
@@ -42,7 +42,7 @@ var RenderJs = (function () {
loadGadgetFromUrl
:
function
(
gadget
)
{
/* Load gadget's SPECs from URL */
var
url
,
gadget_id
,
gadget_property
,
cacheable
,
cache_id
,
app_cache
,
data
,
gadget_js
;
url
=
gadget
.
attr
(
"
gadget
"
);
url
=
gadget
.
attr
(
"
data-
gadget
"
);
gadget_id
=
gadget
.
attr
(
"
id
"
);
// register gadget in javascript namespace
...
...
@@ -50,7 +50,7 @@ var RenderJs = (function () {
RenderJs
.
GadgetIndex
.
registerGadget
(
gadget_js
);
if
(
url
!==
undefined
&&
url
!==
""
){
gadget_property
=
gadget
.
attr
(
"
gadget:property
"
);
gadget_property
=
gadget
.
attr
(
"
data-
gadget:property
"
);
cacheable
=
false
;
if
(
gadget_property
!==
undefined
)
{
gadget_property
=
$
.
parseJSON
(
gadget_property
);
...
...
@@ -152,8 +152,8 @@ var RenderJs = (function () {
updateGadgetData
:
function
(
gadget
)
{
/* Do real gagdet update here */
var
data_source
,
data_handler
;
data_source
=
gadget
.
attr
(
"
gadget:data-source
"
);
data_handler
=
gadget
.
attr
(
"
gadget:data-handler
"
);
data_source
=
gadget
.
attr
(
"
data-
gadget:data-source
"
);
data_handler
=
gadget
.
attr
(
"
data-
gadget:data-handler
"
);
// acquire data and pass it to method handler
if
(
data_source
!==
undefined
){
$
.
ajax
({
url
:
data_source
,
...
...
@@ -306,9 +306,9 @@ var RenderJs = (function () {
tab_container
=
$
(
'
#
'
+
dom_id
);
tab_container
.
empty
();
html_string
=
[
'
<div class="gadget"
'
,
'
gadget="
'
+
gadget
+
'
"
'
,
'
gadget:data-handler="
'
+
gadget_data_handler
+
'
"
'
,
'
gadget:data-source="
'
+
gadget_data_source
+
'
"></div>
'
].
join
(
'
\n
'
);
'
data-
gadget="
'
+
gadget
+
'
"
'
,
'
data-
gadget:data-handler="
'
+
gadget_data_handler
+
'
"
'
,
'
data-
gadget:data-source="
'
+
gadget_data_source
+
'
"></div>
'
].
join
(
'
\n
'
);
tab_container
.
append
(
html_string
);
tab_gadget
=
tab_container
.
find
(
"
.gadget
"
);
...
...
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