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
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
Gabriel Monnerat
renderjs
Commits
18d4f072
Commit
18d4f072
authored
Apr 07, 2014
by
Thibaut Frain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract JS even if type='text/javascript' not set
parent
4965eab4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
renderjs.js
renderjs.js
+3
-1
test/renderjs_test.js
test/renderjs_test.js
+10
-0
No files found.
renderjs.js
View file @
18d4f072
...
@@ -605,7 +605,9 @@
...
@@ -605,7 +605,9 @@
// element.href returns absolute URL in firefox but "" in chrome;
// element.href returns absolute URL in firefox but "" in chrome;
if
(
element
.
rel
===
"
stylesheet
"
)
{
if
(
element
.
rel
===
"
stylesheet
"
)
{
settings
.
required_css_list
.
push
(
element
.
getAttribute
(
"
href
"
));
settings
.
required_css_list
.
push
(
element
.
getAttribute
(
"
href
"
));
}
else
if
(
element
.
type
===
"
text/javascript
"
)
{
}
else
if
(
element
.
nodeName
===
"
SCRIPT
"
&&
(
element
.
type
===
"
text/javascript
"
||
!
element
.
type
))
{
settings
.
required_js_list
.
push
(
element
.
getAttribute
(
"
src
"
));
settings
.
required_js_list
.
push
(
element
.
getAttribute
(
"
src
"
));
}
else
if
(
element
.
rel
===
"
http://www.renderjs.org/rel/interface
"
)
{
}
else
if
(
element
.
rel
===
"
http://www.renderjs.org/rel/interface
"
)
{
settings
.
interface_list
.
push
(
element
.
getAttribute
(
"
href
"
));
settings
.
interface_list
.
push
(
element
.
getAttribute
(
"
href
"
));
...
...
test/renderjs_test.js
View file @
18d4f072
...
@@ -298,6 +298,16 @@
...
@@ -298,6 +298,16 @@
});
});
});
});
test
(
'
Extract JS even if type="text/javascript" not set
'
,
function
()
{
var
settings
,
html
=
"
<html><head>
"
+
"
<script src='../lib/qunit/qunit.js'></script
"
+
"
</head></html>
"
;
settings
=
parseGadgetHTML
(
html
,
"
http://test.org/foo
"
);
deepEqual
(
settings
.
required_js_list
,
[
"
../lib/qunit/qunit.js
"
]);
});
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// declareGadgetKlass
// declareGadgetKlass
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
...
...
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