* Modify api doc view.
This commit is contained in:
@@ -621,7 +621,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'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
@@ -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'");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user