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
a78349f5
Commit
a78349f5
authored
May 14, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3477 from thiagotalma/gii-checkbox
Control checkbox in the preview window.
parents
f648d0b1
69385ad1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
gii.js
extensions/gii/assets/gii.js
+16
-0
files.php
extensions/gii/views/default/view/files.php
+1
-0
No files found.
extensions/gii/assets/gii.js
View file @
a78349f5
...
@@ -45,6 +45,8 @@ yii.gii = (function ($) {
...
@@ -45,6 +45,8 @@ yii.gii = (function ($) {
$modal
.
find
(
'.modal-title'
).
text
(
$link
.
data
(
'title'
));
$modal
.
find
(
'.modal-title'
).
text
(
$link
.
data
(
'title'
));
$modal
.
find
(
'.modal-body'
).
html
(
'Loading ...'
);
$modal
.
find
(
'.modal-body'
).
html
(
'Loading ...'
);
$modal
.
modal
(
'show'
);
$modal
.
modal
(
'show'
);
var
checked
=
$
(
'a.'
+
$modal
.
data
(
'action'
)
+
'[href="'
+
$link
.
attr
(
'href'
)
+
'"]'
).
closest
(
'tr'
).
find
(
'input'
).
get
(
0
).
checked
;
$modal
.
find
(
'.modal-checkbox span'
).
toggleClass
(
'glyphicon-check'
,
checked
).
toggleClass
(
'glyphicon-unchecked'
,
!
checked
);
$
.
ajax
({
$
.
ajax
({
type
:
'POST'
,
type
:
'POST'
,
cache
:
false
,
cache
:
false
,
...
@@ -57,6 +59,7 @@ yii.gii = (function ($) {
...
@@ -57,6 +59,7 @@ yii.gii = (function ($) {
var
index
=
$files
.
filter
(
'[href="'
+
$link
.
attr
(
'href'
)
+
'"]'
).
index
(
filesSelector
);
var
index
=
$files
.
filter
(
'[href="'
+
$link
.
attr
(
'href'
)
+
'"]'
).
index
(
filesSelector
);
var
$prev
=
$files
.
eq
(
index
-
1
);
var
$prev
=
$files
.
eq
(
index
-
1
);
var
$next
=
$files
.
eq
((
index
+
1
==
$files
.
length
?
0
:
index
+
1
));
var
$next
=
$files
.
eq
((
index
+
1
==
$files
.
length
?
0
:
index
+
1
));
$modal
.
data
(
'current'
,
$files
.
eq
(
index
));
$modal
.
find
(
'.modal-previous'
).
attr
(
'href'
,
$prev
.
attr
(
'href'
)).
data
(
'title'
,
$prev
.
data
(
'title'
));
$modal
.
find
(
'.modal-previous'
).
attr
(
'href'
,
$prev
.
attr
(
'href'
)).
data
(
'title'
,
$prev
.
data
(
'title'
));
$modal
.
find
(
'.modal-next'
).
attr
(
'href'
,
$next
.
attr
(
'href'
)).
data
(
'title'
,
$next
.
data
(
'title'
));
$modal
.
find
(
'.modal-next'
).
attr
(
'href'
,
$next
.
attr
(
'href'
)).
data
(
'title'
,
$next
.
data
(
'title'
));
}
}
...
@@ -77,8 +80,21 @@ yii.gii = (function ($) {
...
@@ -77,8 +80,21 @@ yii.gii = (function ($) {
$
(
'.modal-next'
).
trigger
(
'click'
);
$
(
'.modal-next'
).
trigger
(
'click'
);
}
else
if
(
e
.
keyCode
===
82
)
{
}
else
if
(
e
.
keyCode
===
82
)
{
$
(
'.modal-refresh'
).
trigger
(
'click'
);
$
(
'.modal-refresh'
).
trigger
(
'click'
);
}
else
if
(
e
.
keyCode
===
32
)
{
$
(
'.modal-checkbox'
).
trigger
(
'click'
);
}
}
});
});
$
(
'.modal-checkbox'
).
on
(
'click'
,
checkFileToggle
);
};
var
checkFileToggle
=
function
()
{
var
$modal
=
$
(
'#preview-modal'
);
var
$checkbox
=
$modal
.
data
(
'current'
).
closest
(
'tr'
).
find
(
'input'
);
var
checked
=
!
$checkbox
.
prop
(
'checked'
);
$checkbox
.
prop
(
'checked'
,
checked
);
$modal
.
find
(
'.modal-checkbox span'
).
toggleClass
(
'glyphicon-check'
,
checked
).
toggleClass
(
'glyphicon-unchecked'
,
!
checked
);
return
false
;
};
};
var
checkAllToggle
=
function
()
{
var
checkAllToggle
=
function
()
{
...
...
extensions/gii/views/default/view/files.php
View file @
a78349f5
...
@@ -98,6 +98,7 @@ use yii\gii\CodeFile;
...
@@ -98,6 +98,7 @@ use yii\gii\CodeFile;
<a
class=
"modal-previous btn btn-xs btn-default"
href=
"#"
title=
"Previous File (Left Arrow)"
><span
class=
"glyphicon glyphicon-arrow-left"
></span></a>
<a
class=
"modal-previous btn btn-xs btn-default"
href=
"#"
title=
"Previous File (Left Arrow)"
><span
class=
"glyphicon glyphicon-arrow-left"
></span></a>
<a
class=
"modal-next btn btn-xs btn-default"
href=
"#"
title=
"Next File (Right Arrow)"
><span
class=
"glyphicon glyphicon-arrow-right"
></span></a>
<a
class=
"modal-next btn btn-xs btn-default"
href=
"#"
title=
"Next File (Right Arrow)"
><span
class=
"glyphicon glyphicon-arrow-right"
></span></a>
<a
class=
"modal-refresh btn btn-xs btn-default"
href=
"#"
title=
"Refresh File (R)"
><span
class=
"glyphicon glyphicon-refresh"
></span></a>
<a
class=
"modal-refresh btn btn-xs btn-default"
href=
"#"
title=
"Refresh File (R)"
><span
class=
"glyphicon glyphicon-refresh"
></span></a>
<a
class=
"modal-checkbox btn btn-xs btn-default"
href=
"#"
title=
"Check This File (Space)"
><span
class=
"glyphicon"
></span></a>
</div>
</div>
<strong
class=
"modal-title pull-left"
>
Modal title
</strong>
<strong
class=
"modal-title pull-left"
>
Modal title
</strong>
...
...
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