Проблема с интеграцией плагина tinybrowser в редактор tiny_mce

Статус
В этой теме нельзя размещать новые ответы.

inmy

Мой дом здесь!
Регистрация
13 Апр 2012
Сообщения
405
Реакции
304
Собственно возникает ошибка при интеграции с редактором,в инициализаторе прописал в массив плагинов вписал:
tinyBrowser
в массив с включением кнопок добавил:
tinyBrowser
не стал добивать в массив функцию инициализации:
PHP:
file_browser_callback : "tinyBrowser"
потому как взял переделанные два файла что закинул в папку для подхвата самим браузером:
editor_plugin.js
PHP:
/**
* @author Antonov Andrey http://dustweb.ru/ыы
* @[USER=294783]CopyRight[/USER] Copyright  2008-2009, Antonov A Andrey, All rights reserved.
*/

(function() {
    // Load plugin specific language pack
    //tinymce.PluginManager.requireLangPack('example');
    tinymce.create('tinymce.plugins.TinyBrowserPlugin', {
        init : function(ed, url) {
            // Register commands
            ed.addCommand('mceTinyBrowser', function() {
                ed.windowManager.open({
                    file : url + '/tinybrowser.php',
                    width : 700 + parseInt(ed.getLang('images.delta_width', 0)),
                    height : 450 + parseInt(ed.getLang('images.delta_height', 0)),
                    inline: true,
                    popup_css : false
                }, {
                    plugin_url : url
                });
            });

            // Register buttons
            ed.addButton('tinybrowser', {
                title : 'Менджер изображений',
                cmd : 'mceTinyBrowser',
                image : url + '/img/icon.gif'
            });
        },

        getInfo : function() {
            return {
                longname : 'Менджер изображений',
                author : 'Antonov Andrey',
                authorurl : 'http://dustweb.ru',
                infourl : 'http://dustweb.ru/log/projects/tinymce_images/',
                version : '1.1 beta 2'
            };
        }
    });

    // Register plugin
    tinymce.PluginManager.add('tinybrowser', tinymce.plugins.TinyBrowserPlugin);
})();
и второй файл инициализации:
editor_plugin_src.js
PHP:
/**
* @author Antonov Andrey http://dustweb.ru/
* @[USER=294783]CopyRight[/USER] Copyright ? 2008-2009, Antonov A Andrey, All rights reserved.
*/

(function() {
    // Load plugin specific language pack
    //tinymce.PluginManager.requireLangPack('example');
    tinymce.create('tinymce.plugins.TinyBrowserPlugin', {
        init : function(ed, url) {
            // Register commands
            ed.addCommand('mceTinyBrowser', function() {
                ed.windowManager.open({
                    file : url + '/tinybrowser.php',
                    width : 700 + parseInt(ed.getLang('images.delta_width', 0)),
                    height : 450 + parseInt(ed.getLang('images.delta_height', 0)),
                    inline: true,
                    popup_css : false
                }, {
                    plugin_url : url
                });
            });

            // Register buttons
            ed.addButton('tinybrowser', {
                title : 'Файловый менеджер',
                cmd : 'mceTinyBrowser',
                image : url + '/img/icon.gif'
            });
        },

        getInfo : function() {
            return {
                longname : 'Файловый менеджер',
                author : 'Antonov Andrey',
                authorurl : 'http://dustweb.ru',
                infourl : 'http://dustweb.ru/log/projects/tinymce_images/',
                version : '1.1 beta 2'
            };
        }
    });

    // Register plugin
    tinymce.PluginManager.add('tinybrowser', tinymce.plugins.TinyBrowserPlugin);
})();
плагины переделаны от плагина менеджер изображений 1.1

собственно поля перестают грузиться,и в дебагере выскакивает ошибка:
[10:32:21.615] "Failed to load: Для просмотра ссылки Войди или Зарегистрируйся"
хотя два этих плагина лежат,и ни в несжатом формате у меня в директории тинибраузера
 
файл по адресу engine/editor/jscripts/tiny_mce/plugins/tinyBrowser/editor_plugin.js (если в браузере строку ввести) открывается?
 
файл по адресу engine/editor/jscripts/tiny_mce/plugins/tinyBrowser/editor_plugin.js (если в браузере строку ввести) открывается?
регистер глобалс не дал из нижнего регистра запустить инициализацию плагина,теперь вторая проблема образовалась:
не выводит в в панели редактора иконку.хотя я её залил и в плагине прописал для подгрузки,дебагер молчит по поводу неё
 
не выводит в в панели редактора иконку.хотя я её залил и в плагине прописал для подгрузки,дебагер молчит по поводу неё
Опять же..
- производится ли обращение по адресу иконки?
- открывается ли файл в браузере?
- есть ли 404 ошибки в (F12+Network)?
 
Опять же..
- производится ли обращение по адресу иконки?
- открывается ли файл в браузере?
- есть ли 404 ошибки в (F12+Network)?
иконка открываеться,но сам браузер инициируеться через плагин image тоесть не срабатывает инициализация через tinyBrowser
в принципе вот сам код через который инициируеться сам редактор с плагинами:
PHP:
<?php

if(!defined('DATALIFEENGINE')){
    die("Hacking attempt!");
}


class fmod_mceEditor{
    var $area;
    var $post_id;
    var $textarea = true;
   
    function faq_mceEditor($MOD_NAME, $config, $lang, $faq_lang){
        $this->MOD_NAME = $MOD_NAME;
        $this->config = $config;
        $this->lang = $lang;
        $this->faq_lang = $mod_lang;
        $this->content = '<script type="text/javascript" src="'.$this->config['http_home_url'].'engine/editor/jscripts/tiny_mce/jquery.tinymce.js"></script>
        <script type="text/javascript" src="'.$this->config['http_home_url'].'engine/editor/jscripts/tiny_mce/plugins/tinyBrowser/tb_tinymce.js.php"></script>';
    }
   
   
   
    function init_script(){
        if($this->area == false){die('not allowed area and post id');}
        $this->editor_id = ($this->editor_id) ? '#dleeditnews'.$this->post_id : '.mceEditor';
        $this->images = ($this->images) ? 'image,|,' : '';
        $this->video = ($this->video) ? 'dle_mp,dle_mp3,dle_tube,media,|,' : '';
        $this->allow_upload = ($this->images OR $this->files OR $this->video) ? 'dle_upload,|,' : '';
       
       
        $this->content .= <<<HTML
<script type="text/javascript">
$(function(){

    $('{$this->editor_id}').tinymce({
        script_url : '{$this->config['http_home_url']}engine/editor/jscripts/tiny_mce/tiny_mce.js',
        theme : "advanced",
        skin : "cirkuit",
        language : "{$this->lang['wysiwyg_language']}",
        width : "98%",
        height : "250",
        plugins : "layer,table,style,spellchecker,advimage,advlist,emotions,inlinepopups,insertdatetime,media,searchreplace,contextmenu,paste,fullscreen,nonbreaking,typograf,tinyBrowser",
        file_browser_callback : "tinyBrowser",
        relative_urls : false,
        convert_urls : false,
        media_strict : false,
        force_p_newlines : false,
        force_br_newlines : true,
       
        dialog_type : 'window',
        extended_valid_elements : "noindex,div[align|class|style|id|title]",
        custom_elements : 'noindex',

        // Theme options
        theme_advanced_buttons1 : "formatselect,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,forecolor,backcolor",
        theme_advanced_buttons2 : "link,unlink,dle_leech,|, undo,redo,|,spellchecker,typograf,|,sub,sup,|,charmap,visualaid,|,insertdate,inserttime,|,removeformat,cleanup,code",
        theme_advanced_buttons3 : "{$this->allow_upload}{$this->images}{$this->video}emotions,tinyBrowser,dle_spoiler,|,dle_quote,dle_code,dle_hide",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,
        theme_advanced_resizing_use_cookie : false,
       
       
        plugin_insertdate_dateFormat : "%d-%m-%Y",
        plugin_insertdate_timeFormat : "%H:%M:%S",
        spellchecker_languages : "+Russian=ru,English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv",
        // Example content CSS (should be your site CSS)
        content_css : "{$this->config['http_home_url']}engine/editor/css/content.css",

        setup : function(ed) {
            ed.addButton('dle_upload', {
                title : '{$this->lang['bb_t_up']}',
                image : '{$this->config['http_home_url']}engine/editor/jscripts/tiny_mce/themes/advanced/img/dle_upload.gif',
                onclick : function() {
                    file_uploader('{$this->MOD_NAME}', '{$this->area}','{$this->post_id}');
                }
            });
            ed.addButton('dle_quote', {
                title : '{$this->lang['bb_t_quote']}',
                image : '{$this->config['http_home_url']}engine/editor/jscripts/tiny_mce/themes/advanced/img/dle_quote.gif',
                onclick : function() {
                    ed.execCommand('mceReplaceContent',false,'[quote]' + ed.selection.getContent() + '[/quote]');
                }
            });
            ed.addButton('dle_hide', {
                title : '{$this->lang['bb_t_hide']}',
                image : '{$this->config['http_home_url']}engine/editor/jscripts/tiny_mce/themes/advanced/img/dle_hide.gif',
                onclick : function() {
                    ed.execCommand('mceReplaceContent',false,'[hide]' + ed.selection.getContent() + '[/hide]');
                }
            });
            ed.addButton('dle_code', {
                title : '{$this->lang['bb_t_code']}',
                image : '{$this->config['http_home_url']}engine/editor/jscripts/tiny_mce/themes/advanced/img/dle_code.gif',
                onclick : function() {
                    ed.execCommand('mceReplaceContent',false,'[code]' + ed.selection.getContent() + '[/code]');
                }
            });
            ed.addButton('dle_leech', {
                title : '{$this->lang['bb_t_leech']}',
                image : '{$this->config['http_home_url']}engine/editor/jscripts/tiny_mce/themes/advanced/img/dle_leech.gif',
                onclick : function() {
                    ed.execCommand('mceReplaceContent',false,"[leech=http://]{\$selection}[/leech]");
                }
            });
            ed.addButton('dle_mp3', {
                title : '',
                image : '{$this->config['http_home_url']}engine/editor/jscripts/tiny_mce/themes/advanced/img/dle_mp3.gif',
                onclick : function() {
                    ed.execCommand('mceInsertContent',false,"[audio=http://]");
                }
            });
           
            ed.addButton('dle_mp', {
                title : '{$this->lang['bb_t_video']} (BB Codes)',
                image : '{$this->config['http_home_url']}engine/editor/jscripts/tiny_mce/themes/advanced/img/dle_mp.gif',
                onclick : function() {
                    ed.execCommand('mceInsertContent',false,"[video=http://]");
                }
            });
            ed.addButton('dle_tube', {
                title : '{$this->lang['bb_t_yvideo']} (BB Codes)',
                image : '{$this->config['http_home_url']}engine/editor/jscripts/tiny_mce/themes/advanced/img/dle_tube.gif',
                onclick : function() {
                    ed.execCommand('mceInsertContent',false,"[youtube=http://]");
                }
            });
            ed.addButton('dle_spoiler', {
                title : '',
                image : '{$this->config['http_home_url']}engine/editor/jscripts/tiny_mce/themes/advanced/img/dle_spoiler.gif',
                onclick : function() {
                    ed.execCommand('mceReplaceContent',false,'[spoiler]' + ed.selection.getContent() + '[/spoiler]');
                }
            });
        }
    });

});
</script>
HTML;

}
    function init_script_comments(){
   
        $this->images = ($this->images) ? 'image,|,' : '';
       
$this->content .= <<<HTML

<script type="text/javascript">
$(function(){
    $('#comments, .comments').tinymce({
        script_url : '{$this->config['http_home_url']}engine/editor/jscripts/tiny_mce/tiny_mce.js',
        theme : "advanced",
        skin : "cirkuit",
        language : "{$this->lang['wysiwyg_language']}",
        width : "460",
        height : "220",
        plugins : "safari,emotions,inlinepopups,typograf,spellchecker",
        convert_urls : false,
        force_p_newlines : false,
        force_br_newlines : true,
        dialog_type : 'window',
        extended_valid_elements : "div[align|class|style|id|title]",

        // Theme options
        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,{$this->images}justifyleft,justifycenter,justifyright, justifyfull,|,bullist,numlist,|,link,dle_leech,|,emotions,dle_quote,dle_spoiler,dle_hide,|,spellchecker,typograf",
        theme_advanced_buttons2 : "",
        theme_advanced_buttons3 : "",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,
        theme_advanced_resizing_use_cookie : false,

        // Example content CSS (should be your site CSS)
        content_css : "{$this->config['http_home_url']}engine/editor/css/content.css",
        setup : function(ed) {
            // Add a custom button
            ed.addButton('dle_quote', {
                title : '{$this->lang['bb_t_quote']}',
                image : '{$this->config['http_home_url']}engine/editor/jscripts/tiny_mce/themes/advanced/img/dle_quote.gif',
                onclick : function() {
                    ed.execCommand('mceReplaceContent',false,'[quote]' + ed.selection.getContent() + '[/quote]');
                }
            });
            ed.addButton('dle_hide', {
                title : '{$this->lang['bb_t_hide']}',
                image : '{$this->config['http_home_url']}engine/editor/jscripts/tiny_mce/themes/advanced/img/dle_hide.gif',
                onclick : function() {
                    ed.execCommand('mceReplaceContent',false,'[hide]' + ed.selection.getContent() + '[/hide]');
                }
            });
            ed.addButton('dle_spoiler', {
                title : '',
                image : '{$this->config['http_home_url']}engine/editor/jscripts/tiny_mce/themes/advanced/img/dle_spoiler.gif',
                onclick : function() {
                    ed.execCommand('mceReplaceContent',false,'[spoiler]' + ed.selection.getContent() + '[/spoiler]');
                }
            });
            ed.addButton('dle_leech', {
                title : '{$this->lang['bb_t_leech']}',
                image : '{$this->config['http_home_url']}engine/editor/jscripts/tiny_mce/themes/advanced/img/dle_leech.gif',
                onclick : function() {
                    ed.execCommand('mceReplaceContent',false,"[leech=http://]{\$selection}[/leech]");
                }
            });
        }
    });
});
</script>
HTML;

        if($this->textarea){
            $this->content .= '<textarea id="comments" name="comments" rows="10" cols="50"></textarea>';
        }
    }
}

$mceEditor = new faq_mceEditor('mod', $config, $lang, $mod_lang);


?>
 
в принципе разобрался как инициировать плагин,но инициализация происходит загрузки изображений,но так и не понял как в код инициализирующего плагина:
editor_plugin.js
PHP:
(function() {
    //tinymce.PluginManager.requireLangPack('example');
    tinymce.create('tinymce.plugins.TinyBrowserPlugin', {
        init : function(ed, url) {
            ed.addCommand('mceTinyBrowser', function() {
                ed.windowManager.open({
                    file : url + '/tinybrowser.php',
                    width : 700 + parseInt(ed.getLang('images.delta_width', 0)),
                    height : 450 + parseInt(ed.getLang('images.delta_height', 0)),
                    inline: true,
                    popup_css : false
                }, {
                    plugin_url : url
                });
            });
            ed.addButton('tinybrowser', {
                title : 'Менджер изображений',
                cmd : 'mceTinyBrowser',
                image : url + '/img/icon.gif'
            });
        },
        getInfo : function() {
            return {
                longname : 'Менджер изображений',
                author : 'Antonov Andrey',
                authorurl : 'http://dustweb.ru',
                infourl : 'http://dustweb.ru/log/projects/tinymce_images/',
                version : '1.1 beta 2'
            };
        }
    });
    tinymce.PluginManager.add('tinybrowser', tinymce.plugins.TinyBrowserPlugin);
})();
впихнуть инициализатор мультизагрузки:
PHP:
tinyBrowserPopUp('type','elementid');
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху