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
0a2a5d46
Commit
0a2a5d46
authored
Mar 04, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2595 from thiagotalma/master
Arrows to display the previous and next files.
parents
3cf9e8f8
facb5469
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
CHANGELOG.md
extensions/gii/CHANGELOG.md
+1
-0
gii.js
extensions/gii/assets/gii.js
+14
-2
files.php
extensions/gii/views/default/view/files.php
+8
-1
No files found.
extensions/gii/CHANGELOG.md
View file @
0a2a5d46
...
...
@@ -13,6 +13,7 @@ Yii Framework 2 gii extension Change Log
-
Enh #1897: diff markup is now copy paste friendly (samdark)
-
Enh #2327: better visual representation of changed files, added header and refresh button to diff modal (thiagotalma)
-
Enh #2491: Added support for using the same base class name of search model and data model in Gii (qiangxue)
-
Enh #2595: Browse through all generated files using right and left arrows (thiagotalma)
2.
0.0 alpha, December 1, 2013
-----------------------------
...
...
extensions/gii/assets/gii.js
View file @
0a2a5d46
...
...
@@ -35,10 +35,13 @@ yii.gii = (function ($) {
};
var
initPreviewDiffLinks
=
function
()
{
$
(
'.preview-code, .diff-code, .modal-refresh'
).
on
(
'click'
,
function
()
{
$
(
'.preview-code, .diff-code, .modal-refresh
, .modal-previous, .modal-next
'
).
on
(
'click'
,
function
()
{
var
$modal
=
$
(
'#preview-modal'
);
var
$link
=
$
(
this
);
$modal
.
find
(
'.modal-refresh'
).
attr
(
'href'
,
$link
.
prop
(
'href'
));
$modal
.
find
(
'.modal-refresh'
).
attr
(
'href'
,
$link
.
attr
(
'href'
));
if
(
$link
.
hasClass
(
'preview-code'
)
||
$link
.
hasClass
(
'diff-code'
))
{
$modal
.
data
(
'action'
,
(
$link
.
hasClass
(
'preview-code'
)
?
'preview-code'
:
'diff-code'
))
}
$modal
.
find
(
'.modal-title'
).
text
(
$link
.
data
(
'title'
));
$modal
.
find
(
'.modal-body'
).
html
(
'Loading ...'
);
$modal
.
modal
(
'show'
);
...
...
@@ -48,6 +51,15 @@ yii.gii = (function ($) {
url
:
$link
.
prop
(
'href'
),
data
:
$
(
'.default-view form'
).
serializeArray
(),
success
:
function
(
data
)
{
if
(
!
$link
.
hasClass
(
'modal-refresh'
))
{
var
filesSelector
=
'a.'
+
$modal
.
data
(
'action'
);
var
$files
=
$
(
filesSelector
);
var
index
=
$files
.
filter
(
'[href="'
+
$link
.
attr
(
'href'
)
+
'"]'
).
index
(
filesSelector
);
var
$prev
=
$files
.
eq
(
index
-
1
);
var
$next
=
$files
.
eq
((
index
+
1
==
$files
.
length
?
0
:
index
+
1
));
$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-body'
).
html
(
data
);
$modal
.
find
(
'.content'
).
css
(
'max-height'
,
(
$
(
window
).
height
()
-
200
)
+
'px'
);
},
...
...
extensions/gii/views/default/view/files.php
View file @
0a2a5d46
...
...
@@ -81,7 +81,14 @@ use yii\gii\CodeFile;
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4><a
class=
"modal-refresh glyphicon glyphicon-refresh"
href=
"#"
></a>
<span
class=
"modal-title"
>
Modal title
</span></h4>
<div
class=
"btn-group pull-left"
>
<a
class=
"modal-previous btn btn-xs btn-default"
href=
"#"
><span
class=
"glyphicon glyphicon-arrow-left"
></span></a>
<a
class=
"modal-next btn btn-xs btn-default"
href=
"#"
><span
class=
"glyphicon glyphicon-arrow-right"
></span></a>
<a
class=
"modal-refresh btn btn-xs btn-default"
href=
"#"
><span
class=
"glyphicon glyphicon-refresh"
></span></a>
</div>
<strong
class=
"modal-title pull-left"
>
Modal title
</strong>
<div
class=
"clearfix"
></div>
</div>
<div
class=
"modal-body"
>
<p>
Please wait ...
</p>
...
...
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