| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
| 5 | <title>TitlePane Test</title> |
| 6 | |
| 7 | <style type="text/css"> |
| 8 | @import "../../../themes/claro/document.css"; |
| 9 | @import "../../css/dijitTests.css"; |
| 10 | </style> |
| 11 | |
| 12 | <link id="themeStyles" rel="stylesheet" href="../../../themes/claro/claro.css"/> |
| 13 | <script type="text/javascript" src="../../../../dojo/dojo.js" |
| 14 | data-dojo-config="async: true, has: { 'dojo-bidi': true }"></script> |
| 15 | |
| 16 | <script type="text/javascript"> |
| 17 | require([ |
| 18 | "doh/runner", |
| 19 | "dojo/dom", |
| 20 | "dojo/parser", |
| 21 | "dojo/query", |
| 22 | "dijit/registry", |
| 23 | "dijit/TitlePane", |
| 24 | "dojo/domReady!" |
| 25 | ], function(doh, dom, parser, query, registry){ |
| 26 | |
| 27 | doh.register("parse", function(){ |
| 28 | return parser.parse(); |
| 29 | }); |
| 30 | |
| 31 | doh.register("tests._BidiSupport.misc.TitlePane.Bidi", [ |
| 32 | { |
| 33 | name: "TitlePane Bidi", |
| 34 | runTest: function(){ |
| 35 | registry.byId("pane_2").set('textDir', "rtl"); |
| 36 | doh.is("rtl", registry.byId("pane_1").titleNode.dir, "title node had direction correspondent to 'textDir'"); |
| 37 | doh.is("rtl", registry.byId("pane_2").titleNode.dir, "title node had direction correspondent to 'textDir'"); |
| 38 | } |
| 39 | } |
| 40 | ]); |
| 41 | |
| 42 | doh.register("log", function(){ |
| 43 | dom.byId('failures').innerHTML = doh._failureCount; |
| 44 | dom.byId('errors').innerHTML = doh._errorCount; |
| 45 | }); |
| 46 | |
| 47 | doh.run(); |
| 48 | }); |
| 49 | </script> |
| 50 | </head> |
| 51 | <body class="claro"> |
| 52 | <h1 class="testTitle"><b>Bidi TitlePane Test</b></h1> |
| 53 | <h1>Title pane with tooltip, textDir == 'auto'</h1> |
| 54 | <div id="pane_1" data-dojo-id="pane1" data-dojo-type="dijit/TitlePane" data-dojo-props='textDir:"auto", title:"\u05e9\u05dc\u05d5\u05dd Title Pane!", |
| 55 | tooltip:"\u05e9\u05dc\u05d5\u05dd I\"m the tooltip for Title Pane\"s title bar!", |
| 56 | style:"width: 500px;" '> |
| 57 | Arabic, Hebrew, Urdu, and Farsi (Persian) are written from right to left, |
| 58 | while numbers and segments of Latin (or Cyrillic or Greek) text are embedded in |
| 59 | this text from left to right. The dual directionality aspects of such |
| 60 | bidirectional (bidi) text are posing challenges to the way this text is processed and presented in computer applications. |
| 61 | |
| 62 | </div> |
| 63 | <h1>Title pane, textDir == 'rtl'</h1> |
| 64 | <div id="pane_2" data-dojo-type="dijit/TitlePane" data-dojo-props='title:"Title Pane!", textDir:"ltr", tooltip:"Title Pane!", style:"width: 500px;"'> |
| 65 | The Unicode Bidirectional Algorithm, which is commonly used for preparation of Bidi text for display, |
| 66 | is not capable to reliably identify the natural base text direction for a given text. |
| 67 | Only a human reader can unfailingly recognize the natural base text direction for a given text. |
| 68 | Support for enforcing the base text direction is provided out of the box by most platforms / technologies, |
| 69 | but very often the default settings do not guarantee proper display of English and Arabic/Hebrew text in the |
| 70 | same application. See for reference: http://w3-03.ibm.com/globalization/page/publish/4353 |
| 71 | </div> |
| 72 | <br>Errors: <span id="errors">?</span> |
| 73 | <br>Failures: <span id="failures">?</span> |
| 74 | </body> |
| 75 | </html> |