Ticket #5291: 5291.patch

File 5291.patch, 3.9 KB (added by Sa'ar Zac Elias, 14 years ago)
  • _samples/ui_usererror.html

     
     1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     2<!--
     3Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
     4For licensing, see LICENSE.html or http://ckeditor.com/license
     5-->
     6<html xmlns="http://www.w3.org/1999/xhtml">
     7<head>
     8        <title>Replace Textareas by Class Name - CKEditor Sample</title>
     9        <meta content="text/html; charset=utf-8" http-equiv="content-type" />
     10        <script type="text/javascript">
     11        function CKEDITOR_USERERROR( evt )
     12        {
     13                document.getElementById( 'userErrorHolder' ).innerHTML += '<div>Error type: ' + evt.data.errorType
     14                        + '<br />Error string: ' + evt.data.errorString + '</div>';
     15        }
     16        </script>
     17        <!-- CKReleaser %REMOVE_LINE%
     18        <script type="text/javascript" src="../ckeditor.js"></script>
     19        CKReleaser %REMOVE_START% -->
     20        <script type="text/javascript" src="../ckeditor_source.js"></script>
     21        <!-- CKReleaser %REMOVE_END% -->
     22        <script src="sample.js" type="text/javascript"></script>
     23        <link href="sample.css" rel="stylesheet" type="text/css" />
     24</head>
     25<body>
     26        <h1>
     27                CKEditor Sample
     28        </h1>
     29        <!-- This <div> holds alert messages to be display in the sample page. -->
     30        <div id="alerts">
     31                <noscript>
     32                        <p>
     33                                <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
     34                                support, like yours, you should still see the contents (HTML data) and you should
     35                                be able to edit it normally, without a rich editor interface.
     36                        </p>
     37                </noscript>
     38                <div id="userErrorHolder"></div>
     39        </div>
     40        <form action="sample_posteddata.php" method="post">
     41                <p>
     42                        <label for="editor1">
     43                                Editor 1:</label><br />
     44                        <textarea class="ckeditor" cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
     45                </p>
     46                <p>
     47                        <input type="submit" value="Submit" />
     48                </p>
     49        </form>
     50        <div id="footer">
     51                <hr />
     52                <p>
     53                        CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a>
     54                </p>
     55                <p id="copy">
     56                        Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico
     57                        Knabben. All rights reserved.
     58                </p>
     59        </div>
     60</body>
     61</html>
  • _source/core/editor.js

     
    414414
    415415                        this.on( 'mode', updateCommandsMode, null, null, 1 );
    416416
     417                        // Make it possible to override the original alert on user error with a custom
     418                        // implementation pointing to a global named CKEDITOR_USERERROR.
     419                        this.on( 'userError', function( evt )
     420                        {
     421                                var userErrorFunction = window.CKEDITOR_USERERROR;
     422                                if ( userErrorFunction )
     423                                        userErrorFunction.call( this, evt );
     424                                else
     425                                        alert( evt.data.errorString );
     426                        });
     427
    417428                        initConfig( this, instanceConfig );
    418429                };
    419430})();
  • _source/plugins/find/dialogs/find.js

     
    604604                                                                                                        dialog.getValueOf( 'find', 'txtFindCaseChk' ),
    605605                                                                                                        dialog.getValueOf( 'find', 'txtFindWordChk' ),
    606606                                                                                                        dialog.getValueOf( 'find', 'txtFindCyclic' ) ) )
    607                                                                                         alert( editor.lang.findAndReplace
    608                                                                                                 .notFoundMsg );
     607                                                                                        editor.fire( 'userError', {
     608                                                                                                errorString : editor.lang.findAndReplace.notFoundMsg,
     609                                                                                                errorType : 'findandreplace_notfound'
     610                                                                                        });
    609611                                                                        }
    610612                                                                }
    611613                                                        ]
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy