do not load scripts for all apps

pull/1/head
Bernhard Posselt 9 years ago committed by Victor Dubiniuk
parent 89fb78855e
commit e9d95b6acd

@ -5,20 +5,20 @@
* *
* @author Frank Karlitschek * @author Frank Karlitschek
* @copyright 2013-2014 Frank Karlitschek karlitschek@kde.org * @copyright 2013-2014 Frank Karlitschek karlitschek@kde.org
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 3 of the License, or any later version. * version 3 of the License, or any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
* *
* You should have received a copy of the GNU Affero General Public * You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
OCP\App::register(array('order' => 70, 'id' => 'documents', 'name' => 'Documents')); OCP\App::register(array('order' => 70, 'id' => 'documents', 'name' => 'Documents'));
@ -27,26 +27,30 @@ OCP\App::register(array('order' => 70, 'id' => 'documents', 'name' => 'Documents
OCP\App::registerPersonal('documents', 'personal'); OCP\App::registerPersonal('documents', 'personal');
OCP\App::addNavigationEntry(array( OCP\App::addNavigationEntry(array(
'id' => 'documents_index', 'id' => 'documents_index',
'order' => 2, 'order' => 2,
'href' => OCP\Util::linkTo('documents/', 'index.php'), 'href' => OCP\Util::linkTo('documents/', 'index.php'),
'icon' => OCP\Util::imagePath('documents', 'documents.svg'), 'icon' => OCP\Util::imagePath('documents', 'documents.svg'),
'name' => OCA\Documents\Config::getL10n()->t('Documents')) 'name' => OCA\Documents\Config::getL10n()->t('Documents'))
); );
//Script for registering file actions //Script for registering file actions
OCP\Util::addScript('documents', 'viewer/viewer'); $url = OC::$server->getRequest()->server['REQUEST_URI'];
if (preg_match('%index.php/apps/files(/.*)?%', $url)) {
OCP\Util::addScript('documents', 'viewer/viewer');
}
if (OCA\Documents\Config::getConverter() !== 'off'){ if (OCA\Documents\Config::getConverter() !== 'off'){
$docFilter = new OCA\Documents\Filter\Office( $docFilter = new OCA\Documents\Filter\Office(
array( array(
'read' => 'read' =>
array ( array (
'target' => 'application/vnd.oasis.opendocument.text', 'target' => 'application/vnd.oasis.opendocument.text',
'format' => 'odt:writer8', 'format' => 'odt:writer8',
'extension' => 'odt' 'extension' => 'odt'
), ),
'write' => 'write' =>
array ( array (
'target' => 'application/msword', 'target' => 'application/msword',
'format' => 'doc', 'format' => 'doc',
@ -57,13 +61,13 @@ if (OCA\Documents\Config::getConverter() !== 'off'){
$docxFilter = new OCA\Documents\Filter\Office( $docxFilter = new OCA\Documents\Filter\Office(
array ( array (
'read' => 'read' =>
array ( array (
'target' => 'application/vnd.oasis.opendocument.text', 'target' => 'application/vnd.oasis.opendocument.text',
'format' => 'odt:writer8', 'format' => 'odt:writer8',
'extension' => 'odt' 'extension' => 'odt'
), ),
'write' => 'write' =>
array ( array (
'target' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'target' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'format' => 'docx', 'format' => 'docx',

Loading…
Cancel
Save