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
Klaus Wölfel
renderjs
Commits
78468a2d
Commit
78468a2d
authored
Jun 04, 2013
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle data uri
parent
f55aeaf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
17 deletions
+44
-17
renderjs.js
renderjs.js
+44
-17
No files found.
renderjs.js
View file @
78468a2d
...
@@ -599,7 +599,7 @@
...
@@ -599,7 +599,7 @@
if
(
callService
)
{
if
(
callService
)
{
// services are stored by URL (not id), so we need to find the service
// services are stored by URL (not id), so we need to find the service
// in our gadget tree by using the URL provided by the service...
// in our gadget tree by using the URL provided by the service...
// and return an id path, so we can create a selector
// and return an id path, so we can create a selector
selector
=
priv
.
constructSelectorForService
(
selector
=
priv
.
constructSelectorForService
(
callService
.
src
,
callService
.
src
,
...
@@ -948,7 +948,7 @@
...
@@ -948,7 +948,7 @@
window
.
top
.
postMessage
(
options
,
window
.
location
.
href
);
window
.
top
.
postMessage
(
options
,
window
.
location
.
href
);
};
};
// => load gadget
// => load gadget
that
.
addGadget
=
$
.
fn
.
addGadget
=
function
(
options
)
{
that
.
addGadget
=
$
.
fn
.
addGadget
=
function
(
options
)
{
var
adressArray
=
window
.
location
.
href
.
split
(
"
?
"
);
var
adressArray
=
window
.
location
.
href
.
split
(
"
?
"
);
...
@@ -1040,8 +1040,8 @@
...
@@ -1040,8 +1040,8 @@
// body from <SCRIPT> in <HEAD>
// body from <SCRIPT> in <HEAD>
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
// prevent renderJs reloads from different URLs!
// prevent renderJs reloads from different URLs!
// this does not solve the problem of re-requesting dependencies
// this does not solve the problem of re-requesting dependencies
// with ?timestamp=_123241231231 when injecting elements into a page
// with ?timestamp=_123241231231 when injecting elements into a page
// without iFrame
// without iFrame
if
(
window
.
renderJs
===
undefined
)
{
if
(
window
.
renderJs
===
undefined
)
{
priv
.
initialize
();
priv
.
initialize
();
...
@@ -1053,8 +1053,32 @@
...
@@ -1053,8 +1053,32 @@
//////////////////////////////////////////////
//////////////////////////////////////////////
var
default_xhr
=
$
.
ajaxSettings
.
xhr
,
var
default_xhr
=
$
.
ajaxSettings
.
xhr
,
dispatch
;
dispatch
,
dispatch_data
;
dispatch_data
=
function
()
{
// data:[<mediatype>][;base64],<data>
var
regexp
=
/^data:
\/\/([\w\/]
+
)?(
;base64
)?
,
([\w\W]
+
)
/
,
mime_type
,
is_base_64
,
data
;
// window.atob(encodedData);
if
(
regexp
.
test
(
this
.
url
))
{
mime_type
=
regexp
.
exec
(
this
.
url
)[
1
];
is_base_64
=
regexp
.
exec
(
this
.
url
)[
2
];
data
=
regexp
.
exec
(
this
.
url
)[
3
];
if
(
is_base_64
===
'
;base64
'
)
{
this
.
respond
(
200
,
{
'
Content-Type
'
:
mime_type
,
},
window
.
atob
(
data
));
}
else
{
this
.
respond
(
200
,
{
'
Content-Type
'
:
mime_type
,
},
data
);
}
}
else
{
this
.
respond
(
404
,
{},
""
);
}
};
dispatch
=
function
()
{
dispatch
=
function
()
{
// XXX Local hack
// XXX Local hack
var
ls_regexp
=
/^browser:
\/\/
localstorage
\/([\w\W]
+
)
/
,
var
ls_regexp
=
/^browser:
\/\/
localstorage
\/([\w\W]
+
)
/
,
...
@@ -1121,17 +1145,20 @@
...
@@ -1121,17 +1145,20 @@
}
}
};
};
$
.
ajaxSetup
({
$
.
ajaxSetup
({
xhr
:
function
()
{
xhr
:
function
()
{
var
result
;
var
result
;
if
(
/^browser:
\/\/
/
.
test
(
this
.
url
))
{
if
(
/^browser:
\/\/
/
.
test
(
this
.
url
))
{
result
=
new
BrowserHttpRequest
();
result
=
new
BrowserHttpRequest
();
result
.
dispatch
=
dispatch
;
result
.
dispatch
=
dispatch
;
}
else
{
}
else
if
(
/^data:
\/\/
/
.
test
(
this
.
url
))
{
result
=
default_xhr
();
result
=
new
BrowserHttpRequest
();
}
result
.
dispatch
=
dispatch_data
;
return
result
;
}
else
{
}
result
=
default_xhr
();
}
return
result
;
}
});
});
}(
jQuery
,
window
));
}(
jQuery
,
window
));
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