diff --git a/module/api/js/view.js b/module/api/js/view.js new file mode 100644 index 0000000000..f32c457b49 --- /dev/null +++ b/module/api/js/view.js @@ -0,0 +1,121 @@ +/** + * 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'); + $('#content .file-image .right-icon').addClass('hidden'); + $('#content .detail').eq(1).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); + } + } + + $('.main-col iframe').css('min-height', $(window).height() + 'px'); +} + +/** + * Exit full screen. + * + * @access public + * @return void + */ +function exitFullScreen() +{ + $('#mainActions').addClass('hidden'); + $('#content').removeClass('scrollbar-hover'); + $('#content .actions').removeClass('hidden'); + $('#content .file-image .right-icon').removeClass('hidden'); + $('#content .detail').eq(1).removeClass('hidden'); + $('.main-col iframe').css('min-height', '380px'); + $.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(); +}); + +$(function() +{ + $(document).keydown(function(event) + { + if($.cookie('isFullScreen') == 1) + { + if(event.keyCode == 37) $('#prevPage').click(); + if(event.keyCode == 39) $('#nextPage').click(); + } + }); + + if($.cookie('isFullScreen') == 1) fullScreen(); + + $('.menu-actions > a').click(function() + { + $(this).parent().hasClass('open') ? $(this).css('background', 'none') : $(this).css('background', '#f1f1f1'); + }) + + $('.menu-actions > a').blur(function() {$(this).css('background', 'none');}) + + /* Update doc content silently on switch doc version, story #40503 */ + $(document).on('click', '.api-version-menu a, #mainActions .container a', function(event) + { + var $tmpDiv = $('
'); + $tmpDiv.load($(this).data('url') + ' #mainContent', function() + { + $('#content').html($tmpDiv.find('#content').html()); + $('#sidebarContent').html($tmpDiv.find('#sidebarContent').html()); + $('#actionbox .histories-list').html($tmpDiv.find('#actionbox .histories-list').html()); + if($.cookie('isFullScreen') == 1) fullScreen(); + $('#content [data-ride="tree"]').tree(); + $('#outline li.has-list').addClass('open in'); + $('#outline li.has-list>i+ul').prev('i').remove(); + }); + }); +}); diff --git a/module/api/view/content.html.php b/module/api/view/content.html.php index d62e2d3e37..ddc1469a3d 100644 --- a/module/api/view/content.html.php +++ b/module/api/view/content.html.php @@ -22,17 +22,15 @@
+ ', '', "title='{$lang->fullscreen}' class='btn btn-link fullscreen-btn'");?> id"), '', '', "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"); - echo html::a($deleteURL, '', '', "title='{$lang->api->delete}' class='btn btn-link' target='hiddenwin'"); - } + if(common::hasPriv('api', 'edit')) echo html::a(inlink('edit', "apiID=$api->id"), '', '', "title='{$lang->api->edit}' class='btn btn-link' data-app='{$this->app->tab}'"); + if(common::hasPriv('api', 'delete')) echo html::a(inLink('api', 'delete', "apiID=$api->id"), '', '', "title='{$lang->api->delete}' class='btn btn-link' target='hiddenwin'"); } ?> + history?>>
diff --git a/module/doc/control.php b/module/doc/control.php index efda6be843..070a7be53f 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -430,6 +430,10 @@ class doc extends control { $objects = $this->loadModel('product')->getPairs(); } + elseif($objectType == 'mine') + { + $this->lang->doc->aclList = $this->lang->doclib->mySpaceAclList; + } $moduleOptionMenu = $this->doc->getLibsOptionMenu($libs); $moduleID = $moduleID ? (int)$moduleID : (int)$this->cookie->lastDocModule; diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php index e6d2accdf2..c5539430ca 100644 --- a/module/doc/lang/de.php +++ b/module/doc/lang/de.php @@ -36,7 +36,7 @@ $lang->doclib->aclListB['open'] = 'Public'; $lang->doclib->aclListB['custom'] = 'Custom'; $lang->doclib->aclListB['private'] = 'Private'; -$lang->doclib->mySpaceAclList['private'] = "Private (Only creators can access it)"; +$lang->doclib->mySpaceAclList['private'] = "Private (Only creators can access it)"; $lang->doclib->aclList = array(); $lang->doclib->aclList['open'] = "Public (Users who can access doccan access it)"; diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index c8b6ac9d88..6a4c2ee2f6 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -36,7 +36,7 @@ $lang->doclib->aclListB['open'] = 'Public'; $lang->doclib->aclListB['custom'] = 'Custom'; $lang->doclib->aclListB['private'] = 'Private'; -$lang->doclib->mySpaceAclList['private'] = "Private (Only creators can access it)"; +$lang->doclib->mySpaceAclList['private'] = "Private (Only creators can access it)"; $lang->doclib->aclList = array(); $lang->doclib->aclList['open'] = "Public (Users who can access doccan access it)"; diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php index 18bd797704..50e4d76b67 100644 --- a/module/doc/lang/fr.php +++ b/module/doc/lang/fr.php @@ -36,7 +36,7 @@ $lang->doclib->aclListB['open'] = 'Public'; $lang->doclib->aclListB['custom'] = 'Person.'; $lang->doclib->aclListB['private'] = 'Privée'; -$lang->doclib->mySpaceAclList['private'] = "Private (Only creators can access it)"; +$lang->doclib->mySpaceAclList['private'] = "Private (Only creators can access it)"; $lang->doclib->aclList = array(); $lang->doclib->aclList['open'] = "Public (Users who can access doccan access it)"; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index d55bc43115..eecba4cd67 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -36,7 +36,7 @@ $lang->doclib->aclListB['open'] = '公开'; $lang->doclib->aclListB['custom'] = '自定义'; $lang->doclib->aclListB['private'] = '私有'; -$lang->doclib->mySpaceAclList['private'] = "私有 (仅创建者可访问)"; +$lang->doclib->mySpaceAclList['private'] = "私有(仅创建者可访问)"; $lang->doclib->aclList = array(); $lang->doclib->aclList['open'] = "公开 (有文档视图权限即可访问)"; diff --git a/module/doc/view/content.html.php b/module/doc/view/content.html.php index d438656fb2..aa18eb083e 100644 --- a/module/doc/view/content.html.php +++ b/module/doc/view/content.html.php @@ -31,8 +31,12 @@
doc->diff?> + ', '', "title='{$lang->fullscreen}' class='btn btn-link fullscreen-btn'");?> + + collector, ',' . $this->app->user->account . ',') !== false ? 'star' : 'star-empty';?> + id&objectType=doc");?>" title="doc->collect;?>" class='ajaxCollect btn btn-link'> + ', '', "title='{$lang->fullscreen}' class='btn btn-link fullscreen-btn'"); if(common::hasPriv('doc', 'edit')) { $iframe = ''; @@ -44,13 +48,6 @@ } echo html::a(inlink('edit', "docID=$doc->id&comment=false&objectType=$objectType&objectID=$object->id&libID=$libID", '', $onlybody), '', '', "title='{$lang->doc->edit}' class='btn btn-link $iframe' data-app='{$this->app->tab}'"); } - ?> - - collector, ',' . $this->app->user->account . ',') !== false ? 'star' : 'star-empty';?> - id&objectType=doc");?>" title="doc->collect;?>" class='ajaxCollect btn btn-link'> - - - createLink('doc', 'delete', "docID=$doc->id&confirm=yes&from=lib"); diff --git a/module/doc/view/createtexttype.html.php b/module/doc/view/createtexttype.html.php index 0fb9a4ebc5..ff5d0a100c 100644 --- a/module/doc/view/createtexttype.html.php +++ b/module/doc/view/createtexttype.html.php @@ -111,7 +111,7 @@ doclib->control;?> - doc->aclList, 'open', "onchange='toggleAcl(this.value, \"doc\")'");?> + doc->aclList, $objectType == 'mine' ? 'private' : 'open', "onchange='toggleAcl(this.value, \"doc\")'");?>