Merge branch 'release/zentaopms_18.3' of https://gitlab.zcorp.cc/easycorp/zentaopms into release/zentaopms_18.3
This commit is contained in:
@@ -43,13 +43,12 @@ class api extends control
|
||||
{
|
||||
$this->session->set('spaceType', 'api', 'doc');
|
||||
$this->setMenu($libID);
|
||||
|
||||
$objectType = $this->objectType;
|
||||
$objectID = $this->objectID;
|
||||
$objectType = $this->objectType;
|
||||
$objectID = $this->objectID;
|
||||
$isFirstLoad = $libID ? false : true;
|
||||
|
||||
/* Get all api doc libraries. */
|
||||
$loadLib = false;
|
||||
$libs = $this->doc->getApiLibs($appendLib, $objectType, $objectID);
|
||||
$libs = $this->doc->getApiLibs($appendLib, $objectType, $objectID);
|
||||
if(empty($libs) and $objectType != 'nolink')
|
||||
{
|
||||
$objectType = 'nolink';
|
||||
@@ -81,7 +80,6 @@ class api extends control
|
||||
$libID = $lib->id;
|
||||
$objectType = $lib->product ? 'product' : ($lib->project ? 'project' : '');
|
||||
$objectID = $lib->product ? $lib->product : $lib->project;
|
||||
if($loadLib) $libs = $this->doc->getApiLibs($appendLib);
|
||||
}
|
||||
|
||||
/* Get an api doc. */
|
||||
@@ -115,6 +113,7 @@ class api extends control
|
||||
|
||||
$this->view->lib = $lib;
|
||||
$this->view->release = $release;
|
||||
$this->view->isFirstLoad = $isFirstLoad;
|
||||
$this->view->title = $this->lang->api->pageTitle;
|
||||
$this->view->libID = $libID;
|
||||
$this->view->apiID = $apiID;
|
||||
@@ -627,7 +626,7 @@ class api extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->sendSuccess(array('locate' => $this->createLink('api', 'index', "libID=$api->lib&module=$api->module")));
|
||||
return print(js::locate(inlink('index', "libID=$api->lib&module=$api->module"), 'parent'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ form .table-data, #content .table-data {border: 1px solid #e2e2e3;}
|
||||
.main-col .doc-title .info {flex: 1 1 0;}
|
||||
.main-col .doc-title .version a {font-size: 13px; color: #8c8c8c;}
|
||||
.main-col .doc-title .version .dropdown-menu a:hover {color: #ffffff;}
|
||||
.main-col .doc-title .actions {min-width: 120px; display: inline-block;}
|
||||
.main-col .doc-title .actions {display: inline-block;}
|
||||
.main-col .doc-title .actions a + a {margin-left: 8px;}
|
||||
.main-col .doc-title .actions i {font-size: 15px; color: #8c8c8c;}
|
||||
#content h2.title {margin: 0; font-size: 17px;}
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
/**
|
||||
* Ajax delete api doc.
|
||||
*
|
||||
* @param string $link
|
||||
* @param int $replaceID
|
||||
* @param stirng $notice
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function ajaxDeleteApi(link, replaceID)
|
||||
{
|
||||
if(confirm(confirmDelete))
|
||||
{
|
||||
$.get(link, function(data)
|
||||
{
|
||||
location.href = JSON.parse(data).locate;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the document in full screen.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function fullScreen()
|
||||
{
|
||||
var element = document.getElementById('content');
|
||||
var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;
|
||||
if(requestMethod)
|
||||
{
|
||||
var afterEnterFullscreen = function()
|
||||
{
|
||||
$('#mainActions').removeClass('hidden');
|
||||
$('#content').addClass('scrollbar-hover');
|
||||
$('#content .actions').addClass('hidden');
|
||||
$.cookie('isFullScreen', 1);
|
||||
};
|
||||
|
||||
var whenFailEnterFullscreen = function(error)
|
||||
{
|
||||
$.cookie('isFullScreen', 0);
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
var result = requestMethod.call(element);
|
||||
if(result && (typeof result.then === 'function' || result instanceof window.Promise))
|
||||
{
|
||||
result.then(afterEnterFullscreen).catch(whenFailEnterFullscreen);
|
||||
}
|
||||
else
|
||||
{
|
||||
afterEnterFullscreen();
|
||||
}
|
||||
}
|
||||
catch (error)
|
||||
{
|
||||
whenFailEnterFullscreen(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Exit full screen.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function exitFullScreen()
|
||||
{
|
||||
$('#mainActions').addClass('hidden');
|
||||
$('#content').removeClass('scrollbar-hover');
|
||||
$('#content .actions').removeClass('hidden');
|
||||
$.cookie('isFullScreen', 0);
|
||||
}
|
||||
document.addEventListener('fullscreenchange', function (e)
|
||||
{
|
||||
if(!document.fullscreenElement) exitFullScreen();
|
||||
});
|
||||
|
||||
document.addEventListener('webkitfullscreenchange', function (e)
|
||||
{
|
||||
if(!document.webkitFullscreenElement) exitFullScreen();
|
||||
});
|
||||
|
||||
document.addEventListener('mozfullscreenchange', function (e)
|
||||
{
|
||||
if(!document.mozFullScreenElement) exitFullScreen();
|
||||
});
|
||||
|
||||
document.addEventListener('msfullscreenChange', function (e)
|
||||
{
|
||||
if(!document.msfullscreenElement) exitFullScreen();
|
||||
});
|
||||
@@ -93,7 +93,7 @@
|
||||
{
|
||||
if($app->rawModule == 'doc')
|
||||
{
|
||||
echo html::a($this->createLink('api', 'create', "libID=$libID&moduleID=$moduleID", '', true), '<i class="icon icon-plus"></i> ' . $lang->api->createApi, '', 'class="btn btn-info iframe" data-width="95%"');
|
||||
echo html::a($this->createLink('api', 'create', "libID=$libID&moduleID=$moduleID", '', true), '<i class="icon icon-plus"></i> ' . $lang->api->createApi, '', 'class="btn btn-info iframe" data-width="95%"');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -115,7 +115,7 @@
|
||||
<?php foreach($apiList as $api):?>
|
||||
<li class="list-group-item">
|
||||
<div class="heading <?php echo $api->method;?>">
|
||||
<a href="<?php echo helper::createLink('api', 'index', "libID={$api->lib}&moduleID=0&apiID={$api->id}&version=0&release=$release");?>">
|
||||
<a href="<?php echo helper::createLink('api', 'index', "libID={$api->lib}&moduleID=0&apiID={$api->id}&version=0&release=$release");?>" data-app="<?php echo $app->tab;?>">
|
||||
<span class="label label-primary"><?php echo $api->method;?></span>
|
||||
<span class="path" title="<?php echo $api->path;?>"><?php echo $api->path;?></span>
|
||||
<span class="desc" title="<?php echo $api->title;?>"><?php echo $api->title;?></span>
|
||||
|
||||
@@ -23,14 +23,13 @@
|
||||
</div>
|
||||
<div class="actions">
|
||||
<?php
|
||||
echo html::a("javascript:fullScreen()", '<i class="icon-fullscreen"></i>', '', "title='{$lang->fullscreen}' class='btn btn-link fullscreen-btn'");
|
||||
if(!$isRelease)
|
||||
{
|
||||
if(common::hasPriv('api', 'edit')) echo html::a(inlink('edit', "apiID=$api->id"), '<i class="icon-edit"></i>', '', "title='{$lang->api->edit}' class='btn btn-link' data-app='{$this->app->tab}'");
|
||||
if(common::hasPriv('api', 'delete'))
|
||||
{
|
||||
$deleteURL = $this->createLink('api', 'delete', "apiID=$api->id&confirm=yes");
|
||||
echo html::a("javascript:ajaxDeleteApi(\"$deleteURL\", confirmDelete)", '<i class="icon-trash"></i>', '', "title='{$lang->api->delete}' class='btn btn-link'");
|
||||
$deleteURL = $this->createLink('api', 'delete', "apiID=$api->id");
|
||||
echo html::a($deleteURL, '<i class="icon-trash"></i>', '', "title='{$lang->api->delete}' class='btn btn-link' target='hiddenwin'");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='table-footer'><?php $pager->show('right', 'pagerjs');?></div>
|
||||
</form>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
@@ -1194,7 +1194,7 @@ class doc extends control
|
||||
*/
|
||||
public function tableContents($type = 'custom', $objectID = 0, $libID = 0, $moduleID = 0, $browseType = 'all', $orderBy = 'status,id_desc', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$this->view->isFirstLoad = $objectID == 0 ? 'true' : 'false';
|
||||
$isFirstLoad = $libID == 0 ? true : false;
|
||||
$this->session->set('createProjectLocate', $this->app->getURI(true), 'doc');
|
||||
$this->session->set('spaceType', $type, 'doc');
|
||||
|
||||
@@ -1253,6 +1253,7 @@ class doc extends control
|
||||
$this->view->type = $type;
|
||||
$this->view->objectType = $type;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->isFirstLoad = $isFirstLoad;
|
||||
$this->view->param = $queryID;
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->view->libTree = $libTree;
|
||||
|
||||
@@ -253,7 +253,9 @@ $(function()
|
||||
if(item.active) $li.addClass('active');
|
||||
}
|
||||
});
|
||||
if(isFirstLoad !== 'false') ele.data('zui.tree').collapse();
|
||||
|
||||
if(isFirstLoad) ele.data('zui.tree').collapse();
|
||||
|
||||
var $leaf = ele.find('li.active');
|
||||
if($leaf.length) $leaf[$leaf.length - 1].scrollIntoView(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user