Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
52bf6ac4
Commit
52bf6ac4
authored
Nov 19, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1241 from Alex-Code/script-filter
Update script filter
parents
7d9639ea
719e3bca
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
yii.js
framework/yii/assets/yii.js
+5
-7
No files found.
framework/yii/assets/yii.js
View file @
52bf6ac4
...
@@ -219,19 +219,17 @@ yii = (function ($) {
...
@@ -219,19 +219,17 @@ yii = (function ($) {
function
initScriptFilter
()
{
function
initScriptFilter
()
{
var
hostInfo
=
location
.
protocol
+
'//'
+
location
.
host
;
var
hostInfo
=
location
.
protocol
+
'//'
+
location
.
host
;
var
loadedScripts
=
$
(
'script'
).
filter
(
function
()
{
var
loadedScripts
=
$
(
'script[src]'
).
map
(
function
()
{
return
this
.
src
;
}).
map
(
function
()
{
return
this
.
src
.
charAt
(
0
)
===
'/'
?
hostInfo
+
this
.
src
:
this
.
src
;
return
this
.
src
.
charAt
(
0
)
===
'/'
?
hostInfo
+
this
.
src
:
this
.
src
;
}).
toArray
();
}).
toArray
();
$
.
ajaxPrefilter
(
'script'
,
function
(
options
,
originalOptions
,
xhr
)
{
$
.
ajaxPrefilter
(
'script'
,
function
(
options
,
originalOptions
,
xhr
)
{
var
url
=
options
.
url
.
charAt
(
0
)
===
'/'
?
hostInfo
+
options
.
url
:
options
.
url
;
var
url
=
options
.
url
.
charAt
(
0
)
===
'/'
?
hostInfo
+
options
.
url
:
options
.
url
;
if
(
loadedScripts
.
indexOf
(
url
)
<
0
)
{
if
(
$
.
inArray
(
url
,
loadedScripts
)
===
-
1
)
{
loadedScripts
.
push
(
url
);
loadedScripts
.
push
(
url
);
}
else
{
}
else
{
var
found
=
pub
.
reloadableScripts
.
map
(
function
(
)
{
var
found
=
$
.
inArray
(
url
,
$
.
map
(
pub
.
reloadableScripts
,
function
(
script
)
{
return
this
.
charAt
(
0
)
===
'/'
?
hostInfo
+
this
:
this
;
return
script
.
charAt
(
0
)
===
'/'
?
hostInfo
+
script
:
script
;
})
.
indexOf
(
url
)
>=
0
;
})
)
!==
-
1
;
if
(
!
found
)
{
if
(
!
found
)
{
xhr
.
abort
();
xhr
.
abort
();
}
}
...
...
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