/* * Copyright 2007-2017 Charles du Jeu - Abstrium SAS * This file is part of Pydio. * * Pydio is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Pydio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Pydio. If not, see . * * The latest code can be found at . */ 'use strict'; exports.__esModule = true; var _globals = require('../globals'); exports['default'] = function () { var userSelection = _globals.pydio.getUserSelection(); if (userSelection.isUnique() && !userSelection.hasDir()) { var fileName = userSelection.getUniqueFileName(); var selectorData = _globals.pydio.getController().selectorData; if (selectorData.get('type') == "ckeditor") { var ckData = selectorData.get('data'); if (ckData['CKEditorFuncNum']) { var imagePath = fileName; if (ckData['relative_path']) { imagePath = ckData['relative_path'] + fileName; } _globals.global.opener.CKEDITOR.tools.callFunction(ckData['CKEditorFuncNum'], imagePath); _globals.global.close(); } } } }; module.exports = exports['default'];