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
b9c1eff3
Commit
b9c1eff3
authored
Jan 06, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed javascript
parent
c02a6001
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
31 deletions
+49
-31
Renderer.php
extensions/yii/apidoc/templates/html/Renderer.php
+1
-1
Renderer.php
extensions/yii/apidoc/templates/offline/Renderer.php
+0
-19
AssetBundle.php
...sions/yii/apidoc/templates/offline/assets/AssetBundle.php
+31
-0
offline.php
extensions/yii/apidoc/templates/offline/views/offline.php
+16
-10
BaseHtml.php
framework/yii/helpers/BaseHtml.php
+1
-1
No files found.
extensions/yii/apidoc/templates/html/Renderer.php
View file @
b9c1eff3
...
...
@@ -76,7 +76,7 @@ abstract class Renderer extends BaseRenderer implements ViewContextInterface
}
$this
->
_view
->
assetManager
=
new
AssetManager
([
'basePath'
=>
$assetPath
,
'baseUrl'
=>
'/assets'
,
'baseUrl'
=>
'
.
/assets'
,
]);
}
return
$this
->
_view
;
...
...
extensions/yii/apidoc/templates/offline/Renderer.php
View file @
b9c1eff3
...
...
@@ -23,22 +23,4 @@ class Renderer extends \yii\apidoc\templates\html\Renderer
public
$indexView
=
'@yii/apidoc/templates/offline/views/index.php'
;
public
$pageTitle
=
'Yii Framework 2.0 API Documentation'
;
/**
* Renders a given [[Context]].
*
* @param Context $context the api documentation context to render.
* @param Controller $controller the apidoc controller instance. Can be used to control output.
*/
public
function
render
(
$context
,
$controller
)
{
parent
::
render
(
$context
,
$controller
);
$dir
=
Yii
::
getAlias
(
$this
->
targetDir
);
$controller
->
stdout
(
'Copying asset files... '
);
FileHelper
::
copyDirectory
(
__DIR__
.
'/assets/css'
,
$dir
.
'/css'
);
$controller
->
stdout
(
'done.'
.
PHP_EOL
,
Console
::
FG_GREEN
);
}
}
\ No newline at end of file
extensions/yii/apidoc/templates/offline/assets/AssetBundle.php
0 → 100644
View file @
b9c1eff3
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace
yii\apidoc\templates\offline\assets
;
use
yii\web\JqueryAsset
;
use
yii\web\View
;
/**
* The asset bundle for the offline template.
*
* @author Carsten Brandt <mail@cebe.cc>
* @since 2.0
*/
class
AssetBundle
extends
\yii\web\AssetBundle
{
public
$sourcePath
=
'@yii/apidoc/templates/offline/assets/css'
;
public
$css
=
[
'api.css'
,
'style.css'
,
];
public
$depends
=
[
'yii\web\JqueryAsset'
,
];
public
$jsOptions
=
[
'position'
=>
View
::
POS_HEAD
,
];
}
extensions/yii/apidoc/templates/offline/views/offline.php
View file @
b9c1eff3
...
...
@@ -4,6 +4,8 @@
* @var yii\web\View $this
*/
\yii\apidoc\templates\offline\assets\AssetBundle
::
register
(
$this
);
$this
->
beginPage
();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
...
...
@@ -11,9 +13,6 @@ $this->beginPage();
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
<meta
name=
"language"
content=
"en"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/style.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/api.css"
/>
<script
type=
"text/javascript"
src=
"js/jquery.js"
></script>
<?php
$this
->
head
();
?>
<title>
<?php
echo
$this
->
context
->
pageTitle
;
?>
</title>
</head>
...
...
@@ -35,16 +34,22 @@ $this->beginPage();
All Rights Reserved.
<br/>
</div>
<!-- end of footer -->
<?php
\yii\web\JqueryAsset
::
register
(
$this
);
?>
<script
type=
"text/javascript"
>
/*<![CDATA[*/
$
(
"a.toggle"
).
toggle
(
function
(){
$
(
this
).
text
(
$
(
this
).
text
().
replace
(
/Hide/
,
'Show'
));
$
(
this
).
parents
(
".summary"
).
find
(
".inherited"
).
hide
();
},
function
(){
$
(
this
).
text
(
$
(
this
).
text
().
replace
(
/Show/
,
'Hide'
));
$
(
this
).
parents
(
".summary"
).
find
(
".inherited"
).
show
();
$
(
"a.toggle"
).
on
(
'click'
,
function
()
{
var
$this
=
$
(
this
);
if
(
$this
.
hasClass
(
'properties-hidden'
))
{
$this
.
text
(
$this
.
text
().
replace
(
/Show/
,
'Hide'
));
$this
.
parents
(
".summary"
).
find
(
".inherited"
).
show
();
$this
.
removeClass
(
'properties-hidden'
);
}
else
{
$this
.
text
(
$this
.
text
().
replace
(
/Hide/
,
'Show'
));
$this
.
parents
(
".summary"
).
find
(
".inherited"
).
hide
();
$this
.
addClass
(
'properties-hidden'
);
}
return
false
;
});
/*
$(".sourceCode a.show").toggle(function(){
$(this).text($(this).text().replace(/show/,'hide'));
$(this).parents(".sourceCode").find("div.code").show();
...
...
@@ -55,6 +60,7 @@ $(".sourceCode a.show").toggle(function(){
$("a.sourceLink").click(function(){
$(this).attr('target','_blank');
});
*/
/*]]>*/
</script>
...
...
framework/yii/helpers/BaseHtml.php
View file @
b9c1eff3
...
...
@@ -1471,7 +1471,7 @@ class BaseHtml
return
Yii
::
$app
->
getRequest
()
->
getUrl
();
}
else
{
$url
=
Yii
::
getAlias
(
$url
);
if
(
$url
!==
''
&&
(
$url
[
0
]
===
'/'
||
$url
[
0
]
===
'#'
||
strpos
(
$url
,
'://'
)))
{
if
(
$url
!==
''
&&
(
$url
[
0
]
===
'/'
||
$url
[
0
]
===
'#'
||
strpos
(
$url
,
'://'
)
||
!
strncmp
(
$url
,
'./'
,
2
)
))
{
return
$url
;
}
else
{
return
Yii
::
$app
->
getRequest
()
->
getBaseUrl
()
.
'/'
.
$url
;
...
...
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