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
0ced97f2
Commit
0ced97f2
authored
Sep 04, 2012
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sanitize code to follow jslint rules.
parent
08a05c06
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
OfficeJS/src/renderjs/renderjs.js
OfficeJS/src/renderjs/renderjs.js
+18
-15
No files found.
OfficeJS/src/renderjs/renderjs.js
View file @
0ced97f2
/*global console, require, $, localStorage, document */
// by default RenderJs will render all gadgets when page is loaded
// still it's possible to override this and use explicit gadget rendering
var
RENDERJS_ENABLE_IMPLICIT_GADGET_RENDERING
=
true
;
// Add required by RenderJs jstorage library only if used HTML application
// uses requirejs
if
(
typeof
require
!==
'
undefined
'
)
{
if
(
typeof
require
!==
'
undefined
'
)
{
require
([
"
../../../../lib/jstorage/jstorage.js
"
],
function
(
util
)
{
});
}
// fallback for IE
if
(
typeof
console
===
"
undefined
"
||
typeof
console
.
log
===
"
undefined
"
)
{
if
(
typeof
console
===
"
undefined
"
||
typeof
console
.
log
===
"
undefined
"
)
{
console
=
{};
console
.
log
=
function
()
{};
}
...
...
@@ -63,7 +65,7 @@ var RenderJs = (function () {
cacheable
=
gadget
.
attr
(
"
data-gadget-cacheable
"
);
cache_id
=
gadget
.
attr
(
"
data-gadget-cache-id
"
);
if
(
cacheable
!==
undefined
&&
cache_id
!==
undefined
)
{
cacheable
=
Boolean
(
parseInt
(
cacheable
));
cacheable
=
Boolean
(
parseInt
(
cacheable
,
10
));
}
//cacheable = false ; // to develop faster
if
(
cacheable
)
{
...
...
@@ -200,7 +202,8 @@ var RenderJs = (function () {
RenderJs
.
loadGadgetFromUrl
(
tab_gadget
);
// clear previous events
RenderJs
.
GadgetIndex
.
getRootGadget
().
getDom
().
bind
(
"
ready
"
,
function
()
{
"
ready
"
,
function
()
{
if
(
!
is_ready
)
{
RenderJs
.
updateGadgetData
(
tab_gadget
);
is_ready
=
true
;
...
...
@@ -278,7 +281,7 @@ var RenderJs = (function () {
/* Set cache key value */
$
.
jStorage
.
set
(
cache_id
,
data
);
}
}
}
;
}()),
NameSpaceStorageCachePlugin
:
(
function
()
{
...
...
@@ -297,10 +300,10 @@ var RenderJs = (function () {
/* Set cache key value */
namespace
[
cache_id
]
=
data
;
}
}
}())
}
}()),
};
}())
};
}()),
Gadget
:
(
function
(
gadget_id
,
dom
)
{
/*
...
...
@@ -359,7 +362,7 @@ var RenderJs = (function () {
);
// XXX: we should unregister all gadgets (if any we replace now in DOM)
}
}
}
;
}()),
GadgetIndex
:
(
function
()
{
...
...
@@ -439,7 +442,7 @@ var RenderJs = (function () {
*/
// XXX:
}
}
}
;
}()),
InteractionGadget
:
(
function
()
{
...
...
@@ -520,14 +523,14 @@ var RenderJs = (function () {
}
});
}
}
}
;
}())
}
}
;
}());
// impliticly call RenderJs bootstrap
$
(
document
).
ready
(
function
()
{
if
(
RENDERJS_ENABLE_IMPLICIT_GADGET_RENDERING
){
if
(
RENDERJS_ENABLE_IMPLICIT_GADGET_RENDERING
)
{
RenderJs
.
bootstrap
(
$
(
'
body
'
));
}
});
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