PHP Classes

File: htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsimagemanager/plugin.js

Recommend this page to a friend!
  Packages of Michael Beck   Xoops 2.5   htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsimagemanager/plugin.js   Download  
File: htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsimagemanager/plugin.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Xoops 2.5
Modular content management publication system
Author: By
Last change:
Date: 3 months ago
Size: 2,114 bytes
 

Contents

Class file image Download
/** * XOOOPS Image Manager plugin * * @category XoopsEditor * @package TinyMCE5 * @author ForMuss * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @link http://xoops.org */ (function (domGlobals) { 'use strict'; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var ed; var url; var xoopsimagemanager = function(cb, value, meta) { ed.focus(true); window.addEventListener('message', function receiveMessage(event) { window.removeEventListener('message', receiveMessage, false); if (event.data.sender === 'responsivefilemanager') { callback(event.data.url); } }, false); ed.windowManager.openUrl({ title: 'XOOPS Imagemanager', url: url + '/xoopsimagemanager.php?target=src', buttons: [ { type: 'cancel', text: 'Close' } ], width: 800, height: 600, inline: 1, resizable: true, maximizable: true, onMessage: function(instance, event) { switch (event.mceAction) { case 'insertImage': if (event.data.src != '') { setTimeout(() => { cb(event.data.src, { title: event.data.title }); tinymce.activeEditor.windowManager.close(); }, 300); } break; } } }); }; var register = function (editor, pluginUrl) { editor.settings.file_picker_types = 'image'; editor.settings.file_picker_callback = xoopsimagemanager; }; function Plugin () { global.add('xoopsimagemanager', function (editor, pluginUrl) { ed = editor; url = pluginUrl; register(editor, pluginUrl); }); } Plugin(); }(window));