Ticket #7240: 7240.patch

File 7240.patch, 5.1 KB (added by Sa'ar Zac Elias, 13 years ago)
  • _source/plugins/devtools/lang/en.js

     
     1/*
     2Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
     3For licensing, see LICENSE.html or http://ckeditor.com/license
     4*/
     5
     6CKEDITOR.plugins.setLang( 'devtools', 'en',
     7{
     8        devTools :
     9        {
     10                dialogName : 'Dialog name',
     11                tabId   : 'Tab id',
     12                elementId : 'Element id'
     13        }
     14});
  • _source/plugins/devtools/plugin.js

     
     1/*
     2Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
     3For licensing, see LICENSE.html or http://ckeditor.com/license
     4*/
     5
     6CKEDITOR.plugins.add( 'devtools',
     7{
     8        requires : [ 'dialog' ],
     9        lang : [ 'en' ],
     10
     11        init : function( editor )
     12        {
     13                editor._.showDialogDefinitionTooltips = 1;
     14        }
     15});
     16
     17(function()
     18{
     19        function defaultCallback( editor, dialog, element )
     20        {
     21                var lang = editor.lang.devTools;
     22                return (
     23                        lang.dialogName + ': ' + dialog.getName()       + '<br />' +
     24                        lang.tabId      + ': ' + dialog._.currentTabId  + '<br />' +
     25                        lang.elementId  + ': ' + element.id
     26                );
     27        }
     28
     29        var tooltip;
     30        CKEDITOR.on( 'reset', function()
     31        {
     32                tooltip.remove();
     33                tooltip = null;
     34        });
     35
     36        CKEDITOR.on( 'dialogDefinition', function( evt )
     37        {
     38                var editor = evt.editor;
     39                if ( editor._.showDialogDefinitionTooltips )
     40                {
     41                        if ( !tooltip )
     42                        {
     43                                tooltip = CKEDITOR.dom.element.createFromHtml( '<div id="cke_tooltip" tabindex="-1"></div>', CKEDITOR.document );
     44                                tooltip.hide();
     45                                tooltip.on( 'mouseover', function(){ this.show(); } );
     46                                tooltip.on( 'mouseout', function(){ this.hide(); } );
     47                                tooltip.appendTo( CKEDITOR.document.getBody() );
     48                        }
     49
     50                        var dialog = evt.data.definition.dialog,
     51                                callback = editor.config.devtools_textCallback || defaultCallback;
     52
     53                        dialog.on( 'load', function()
     54                        {
     55                                dialog.foreach( function( obj )
     56                                {
     57                                        if ( obj.type in { hbox : 1, vbox : 1 } )
     58                                                return;
     59
     60                                        var el = obj.getElement();
     61                                        el.on( 'mouseover', function()
     62                                        {
     63                                                var pos = el.getDocumentPosition();
     64                                                tooltip.setStyles( { top : pos.y + 'px', 'z-index' : CKEDITOR.dialog._.currentZIndex + 10 } );
     65                                                tooltip.setHtml( callback( editor, dialog, obj ) );
     66                                                tooltip.show();
     67
     68                                                // Translate coordinate for RTL.
     69                                                if ( editor.lang.dir == 'rtl' )
     70                                                {
     71                                                        var width = obj.getInputElement().getSize( 'width' ),
     72                                                                viewPaneSize = CKEDITOR.document.getWindow().getViewPaneSize();
     73                                                        tooltip.setStyle( 'right', ( viewPaneSize.width - width - pos.x ) + 'px' );
     74                                                }
     75                                                else
     76                                                        tooltip.setStyle( 'left', pos.x + 'px' );
     77                                        });
     78                                        el.on( 'mouseout', function()
     79                                        {
     80                                                tooltip.hide();
     81                                        });
     82                                });
     83                        });
     84                }
     85        });
     86})();
     87
     88/**
     89 * A function that returns the text to be displayed inside the developer tooltip when hovering over a dialog UI element.
     90 * There are 3 parameters that are being passed into the function: editor, dialog, element.
     91 * @name editor.config.devtools_textCallback
     92 * @since 3.6
     93 * @type Function
     94 * @default (see example)
     95 * @example
     96 * // This is actually the default value.
     97 * // Show dialog name, tab id and element id.
     98 * config.devtools_textCallback = function( editor, dialog, element )
     99 * {
     100 *      var lang = editor.lang.devTools;
     101 *      return (
     102 *              lang.dialogName + ': ' + dialog.getName()       + '<br />' +
     103 *              lang.tabId      + ': ' + dialog._.currentTabId  + '<br />' +
     104 *              lang.elementId  + ': ' + element.id
     105 *      );
     106 * }
     107 */
  • _source/skins/kama/dialog.css

     
    913913{
    914914        margin-right: 10px;
    915915}
     916
     917#cke_tooltip
     918{
     919        position: absolute;
     920        background-color: black;
     921        color: white;
     922        opacity : 0.8;
     923        filter : alpha(opacity=80);
     924}
  • _source/skins/office2003/dialog.css

     
    824824{
    825825        margin-right: 10px;
    826826}
     827
     828#cke_tooltip
     829{
     830        position: absolute;
     831        background-color: black;
     832        color: white;
     833        opacity : 0.8;
     834        filter : alpha(opacity=80);
     835}
     836 No newline at end of file
  • _source/skins/v2/dialog.css

     
    840840{
    841841        margin-right: 10px;
    842842}
     843
     844#cke_tooltip
     845{
     846        position: absolute;
     847        background-color: black;
     848        color: white;
     849        opacity : 0.8;
     850        filter : alpha(opacity=80);
     851}
     852 No newline at end of file
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy