Changeset 11778

Show
Ignore:
Timestamp:
12/10/07 13:38:54 (7 months ago)
Author:
becky
Message:

refs #5349 - fix in trunk as well as for 1.0.2. Add the text from any label element associated with the editor to the title of the document in the Firefox iframe (for a11y).

Location:
dijit/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • dijit/trunk/tests/test_Editor.html

    r11325 r11778  
    2626<body> 
    2727 
    28         <h1 class="testTitle">Editor + Plugins Test</h1> 
     28        <h1 class="testTitle"><label for="editor1">Editor + Plugins Test</label></h1> 
    2929 
    3030        <div style="border: 1px solid black;"> 
     
    3535        <hr/> 
    3636        <div style="border: 1px dotted black;"> 
    37                 <h3>thud</h3> 
     37                <h3><label for="thud">thud - from textarea</label></h3> 
    3838                <textarea dojoType="dijit.Editor" height="" 
    3939                        extraPlugins="['dijit._editor.plugins.AlwaysShowToolbar']" 
    40                         styleSheets="../../dojo/resources/dojo.css"> 
     40                        styleSheets="../../dojo/resources/dojo.css" id="thud"> 
    4141                        <p> 
    4242                                This editor is created from a textarea with AlwaysShowToolbar plugin (don't forget to set height=""). 
     
    5555        <hr/> 
    5656        <div style="border: 1px dotted black;"> 
    57                 <h3>blah</h3> 
     57                <h3><label for="blah">blah entry</label></h3> 
    5858                <textarea dojoType="dijit.Editor" 
    5959                        plugins="['bold','italic','|','createLink','foreColor','hiliteColor']" 
    60                         styleSheets="../../dojo/resources/dojo.css"> 
     60                        styleSheets="../../dojo/resources/dojo.css" id="blah"> 
    6161                        This instance includes optional toolbar buttons which pull in additional ui (dijit) code. 
    6262                        Note the dojo.require() statements required to pull in the associated editor plugins to make 
     
    6767        <hr/> 
    6868        <div style="border: 1px dotted black;"> 
    69                 <h3>blah</h3> 
     69                <h3><label for="blah2">Another blah entry</label></h3> 
    7070                <textarea dojoType="dijit.Editor" 
    7171                        plugins="['bold','italic','|',{name:'dijit._editor.plugins.LinkDialog'}]" 
    72                         styleSheets="../../dojo/resources/dojo.css"> 
     72                        styleSheets="../../dojo/resources/dojo.css" id="blah2"> 
    7373                        This instance demos how to: 
    7474                        <ol> 
  • dijit/trunk/_editor/RichText.js

    r11771 r11778  
    439439                        // get screen reader text for mozilla here, too 
    440440                        this._localizedIframeTitles = dojo.i18n.getLocalization("dijit", "Textarea"); 
     441                        // need to find any associated label element and update iframe document title 
     442                        var label=dojo.query('label[for="'+this.id+'"]'); 
     443                        if(label.length){ 
     444                                this._localizedIframeTitles.iframeEditTitle = label[0].innerHTML + " " + this._localizedIframeTitles.iframeEditTitle; 
     445                        } 
    441446                } 
    442447                // opera likes this to be outside the with block