Dotclear


Ignore:
Timestamp:
12/11/13 11:35:57 (12 years ago)
Author:
Nicolas <nikrou77@…>
Branch:
default
Message:

Move legacy editor to a plugin. First step for alternate editors.
Addresses #1896

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/lib.dc.page.php

    r2513 r2614  
    589589          '<script type="text/javascript">'."\n". 
    590590          "//<![CDATA[\n". 
     591          'jsToolBar = {}, jsToolBar.prototype = { elements : {} };'."\n". 
    591592          self::jsVar('dotclear.nonce',$GLOBALS['core']->getNonce()). 
    592593          self::jsVar('dotclear.img_plus_src','images/expand.png'). 
     
    828829     } 
    829830 
     831      
    830832     public static function jsToolBar() 
    831833     { 
    832           $res = 
    833           '<link rel="stylesheet" type="text/css" href="style/jsToolBar/jsToolBar.css" />'. 
    834           '<script type="text/javascript" src="js/jsToolBar/jsToolBar.js"></script>'; 
    835  
    836           if (isset($GLOBALS['core']->auth) && $GLOBALS['core']->auth->getOption('enable_wysiwyg')) { 
    837                $res .= '<script type="text/javascript" src="js/jsToolBar/jsToolBar.wysiwyg.js"></script>'; 
    838           } 
    839  
    840           $res .= 
    841           '<script type="text/javascript" src="js/jsToolBar/jsToolBar.dotclear.js"></script>'. 
    842           '<script type="text/javascript">'."\n". 
    843           "//<![CDATA[\n". 
    844           "jsToolBar.prototype.dialog_url = 'popup.php'; ". 
    845           "jsToolBar.prototype.iframe_css = '". 
    846           'body{'. 
    847           'font: 12px "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;'. 
    848           'color : #000;'. 
    849           'background: #f9f9f9;'. 
    850           'margin: 0;'. 
    851           'padding : 2px;'. 
    852           'border: none;'. 
    853           (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl' ? 'direction:rtl;' : ''). 
    854           '}'. 
    855           'pre, code, kbd, samp {'. 
    856           'font-family:"Courier New",Courier,monospace;'. 
    857           'font-size : 1.1em;'. 
    858           '}'. 
    859           'code {'. 
    860           'color : #666;'. 
    861           'font-weight : bold;'. 
    862           '}'. 
    863           'body > p:first-child {'. 
    864           'margin-top: 0;'. 
    865           '}'. 
    866           "'; ". 
    867           "jsToolBar.prototype.base_url = '".html::escapeJS($GLOBALS['core']->blog->host)."'; ". 
    868           "jsToolBar.prototype.switcher_visual_title = '".html::escapeJS(__('visual'))."'; ". 
    869           "jsToolBar.prototype.switcher_source_title = '".html::escapeJS(__('source'))."'; ". 
    870           "jsToolBar.prototype.legend_msg = '". 
    871           html::escapeJS(__('You can use the following shortcuts to format your text.'))."'; ". 
    872           "jsToolBar.prototype.elements.blocks.options.none = '".html::escapeJS(__('-- none --'))."'; ". 
    873           "jsToolBar.prototype.elements.blocks.options.nonebis = '".html::escapeJS(__('-- block format --'))."'; ". 
    874           "jsToolBar.prototype.elements.blocks.options.p = '".html::escapeJS(__('Paragraph'))."'; ". 
    875           "jsToolBar.prototype.elements.blocks.options.h1 = '".html::escapeJS(__('Level 1 header'))."'; ". 
    876           "jsToolBar.prototype.elements.blocks.options.h2 = '".html::escapeJS(__('Level 2 header'))."'; ". 
    877           "jsToolBar.prototype.elements.blocks.options.h3 = '".html::escapeJS(__('Level 3 header'))."'; ". 
    878           "jsToolBar.prototype.elements.blocks.options.h4 = '".html::escapeJS(__('Level 4 header'))."'; ". 
    879           "jsToolBar.prototype.elements.blocks.options.h5 = '".html::escapeJS(__('Level 5 header'))."'; ". 
    880           "jsToolBar.prototype.elements.blocks.options.h6 = '".html::escapeJS(__('Level 6 header'))."'; ". 
    881           "jsToolBar.prototype.elements.strong.title = '".html::escapeJS(__('Strong emphasis'))."'; ". 
    882           "jsToolBar.prototype.elements.em.title = '".html::escapeJS(__('Emphasis'))."'; ". 
    883           "jsToolBar.prototype.elements.ins.title = '".html::escapeJS(__('Inserted'))."'; ". 
    884           "jsToolBar.prototype.elements.del.title = '".html::escapeJS(__('Deleted'))."'; ". 
    885           "jsToolBar.prototype.elements.quote.title = '".html::escapeJS(__('Inline quote'))."'; ". 
    886           "jsToolBar.prototype.elements.code.title = '".html::escapeJS(__('Code'))."'; ". 
    887           "jsToolBar.prototype.elements.br.title = '".html::escapeJS(__('Line break'))."'; ". 
    888           "jsToolBar.prototype.elements.blockquote.title = '".html::escapeJS(__('Blockquote'))."'; ". 
    889           "jsToolBar.prototype.elements.pre.title = '".html::escapeJS(__('Preformated text'))."'; ". 
    890           "jsToolBar.prototype.elements.ul.title = '".html::escapeJS(__('Unordered list'))."'; ". 
    891           "jsToolBar.prototype.elements.ol.title = '".html::escapeJS(__('Ordered list'))."'; ". 
    892  
    893           "jsToolBar.prototype.elements.link.title = '".html::escapeJS(__('Link'))."'; ". 
    894           "jsToolBar.prototype.elements.link.href_prompt = '".html::escapeJS(__('URL?'))."'; ". 
    895           "jsToolBar.prototype.elements.link.hreflang_prompt = '".html::escapeJS(__('Language?'))."'; ". 
    896  
    897           "jsToolBar.prototype.elements.img.title = '".html::escapeJS(__('External image'))."'; ". 
    898           "jsToolBar.prototype.elements.img.src_prompt = '".html::escapeJS(__('URL?'))."'; ". 
    899  
    900           "jsToolBar.prototype.elements.img_select.title = '".html::escapeJS(__('Media chooser'))."'; ". 
    901           "jsToolBar.prototype.elements.post_link.title = '".html::escapeJS(__('Link to an entry'))."'; ". 
    902  
    903           "jsToolBar.prototype.elements.removeFormat.title = '".html::escapeJS(__('Remove text formating'))."'; "; 
    904  
    905           if (!$GLOBALS['core']->auth->check('media,media_admin',$GLOBALS['core']->blog->id)) { 
    906                $res .= "jsToolBar.prototype.elements.img_select.disabled = true;\n"; 
    907           } 
    908  
    909           $res .= 
    910           "\n//]]>\n". 
    911           "</script>\n"; 
    912  
    913           return $res; 
     834          # Deprecated but we keep this for plugins. 
    914835     } 
    915836 
Note: See TracChangeset for help on using the changeset viewer.

Sites map