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
Xiaowu Zhang
renderjs
Commits
cb8b5181
Commit
cb8b5181
authored
Feb 13, 2013
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modifications to play nice with Jquery Mobile DOM structure
parent
fa9b2fa9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
+22
-6
renderjs.js
renderjs.js
+22
-6
No files found.
renderjs.js
View file @
cb8b5181
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
/*global console, require, $, localStorage, document, jIO */
/*global console, require, $, localStorage, document, jIO */
/*jslint evil: true, white: true */
/*jslint evil: true, white: true */
"
use strict
"
;
/*
/*
* RenderJs - Generic Gadget library renderer.
* RenderJs - Generic Gadget library renderer.
* http://www.renderjs.org/documentation
* http://www.renderjs.org/documentation
...
@@ -21,12 +19,13 @@ var RENDERJS_ENABLE_IMPLICIT_INTERACTION_BIND = true;
...
@@ -21,12 +19,13 @@ var RENDERJS_ENABLE_IMPLICIT_INTERACTION_BIND = true;
var
RENDERJS_ENABLE_IMPLICIT_ROUTE_CREATE
=
true
;
var
RENDERJS_ENABLE_IMPLICIT_ROUTE_CREATE
=
true
;
// fallback for IE
// fallback for IE
if
(
typeof
console
===
"
undefined
"
||
typeof
console
.
log
===
"
undefined
"
)
{
if
(
console
===
undefined
||
console
.
log
===
undefined
)
{
var
console
=
{};
var
console
=
{};
console
.
log
=
function
()
{};
console
.
log
=
function
()
{};
}
}
var
RenderJs
=
(
function
()
{
var
RenderJs
=
(
function
()
{
"
use strict
"
;
// a variable indicating if current gadget loading is over or not
// a variable indicating if current gadget loading is over or not
var
is_ready
=
false
;
var
is_ready
=
false
;
...
@@ -49,7 +48,10 @@ var RenderJs = (function () {
...
@@ -49,7 +48,10 @@ var RenderJs = (function () {
function
()
{
function
()
{
if
(
RENDERJS_ENABLE_IMPLICIT_INTERACTION_BIND
)
{
if
(
RENDERJS_ENABLE_IMPLICIT_INTERACTION_BIND
)
{
// examine all Intaction Gadgets and bind accordingly
// examine all Intaction Gadgets and bind accordingly
$
(
"
div[data-gadget-connection]
"
).
each
(
function
(
index
,
element
)
{
$
(
"
div[data-gadget-connection]
"
)
.
filter
(
function
()
{
return
$
(
this
).
data
(
"
bound
"
)
!==
true
;
})
.
data
(
'
bound
'
,
true
)
.
each
(
function
(
index
,
element
)
{
RenderJs
.
InteractionGadget
.
bind
(
$
(
element
));
RenderJs
.
InteractionGadget
.
bind
(
$
(
element
));
});
});
}
}
...
@@ -118,10 +120,24 @@ var RenderJs = (function () {
...
@@ -118,10 +120,24 @@ var RenderJs = (function () {
* Load gadget's SPECs from URL
* Load gadget's SPECs from URL
*/
*/
var
url
,
gadget_id
,
gadget_property
,
cacheable
,
cache_id
,
var
url
,
gadget_id
,
gadget_property
,
cacheable
,
cache_id
,
i
,
gadget_index
,
gadget_index_id
,
app_cache
,
data
,
gadget_js
,
is_update_gadget_data_running
;
app_cache
,
data
,
gadget_js
,
is_update_gadget_data_running
;
url
=
gadget
.
attr
(
"
data-gadget
"
);
url
=
gadget
.
attr
(
"
data-gadget
"
);
gadget_id
=
gadget
.
attr
(
"
id
"
);
gadget_id
=
gadget
.
attr
(
"
id
"
);
gadget_js
=
RenderJs
.
GadgetIndex
.
getGadgetById
(
gadget_id
);
gadget_js
=
RenderJs
.
GadgetIndex
.
getGadgetById
(
gadget_id
);
gadget_index
=
RenderJs
.
GadgetIndex
.
getGadgetList
();
for
(
i
=
0
;
i
<
gadget_index
.
length
;
i
+=
1
)
{
gadget_index_id
=
gadget_index
[
i
].
id
;
// stop here, if the gadget_id is already on the gadgetIndex
// but not when the gadget on the page has no childNodes
// (because it's back to unenhanced status = page reload)
if
(
gadget_index_id
===
gadget_id
&&
$
(
document
.
getElementById
(
gadget_index_id
)).
children
().
length
>
0
)
{
return
;
}
}
if
(
gadget_js
===
undefined
)
{
if
(
gadget_js
===
undefined
)
{
// register gadget in javascript namespace if not already registered
// register gadget in javascript namespace if not already registered
gadget_js
=
new
RenderJs
.
Gadget
(
gadget_id
,
gadget
);
gadget_js
=
new
RenderJs
.
Gadget
(
gadget_id
,
gadget
);
...
@@ -646,7 +662,7 @@ var RenderJs = (function () {
...
@@ -646,7 +662,7 @@ var RenderJs = (function () {
/*
/*
* Register a service provided by a gadget.
* Register a service provided by a 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